Part Number Hot Search : 
F1N05 MA6X128 20005 SD820 2N20DP 555NM DS217 B1403N
Product Description
Full Text Search
 

To Download ST20GP1X33S Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  a 1/116 . . gps processor features n application specific features 12 channel gps correlation dsp hardware and st20 cpu (for control and position calu- culations) on one chip no tcxo required rtca-sc159 / waas / egnos supported n gps performance accuracy - stand alone with sa on <100m, sa off <30m - differential <1m - surveying <1cm time to first fix - autonomous start 90s - cold start 45s - warm start 7s - obscuration 1s n 32-bit st20 cpu 16/33 mhz processor clock 25 mips at 33 mhz fast integer/bit operations n 4 kbytes on-chip sram 130 mbytes/s maximum bandwidth n programmable memory interface 4 separately configurable regions 8/16-bits wide support for mixed memory 2 cycle external access n serial communications programmable uart (asc) os-link n vectored interrupt subsystem 2 dedicated interrupt pins 5 levels of interrupt n power management low power operation power down modes n professional toolset support ansi c compiler and libraries inquest advanced debugging tools n technology static clocked 50 mhz design 3.3 v, sub micron technology n 100 pin pqfp package st20-gp1 engineering data the information in this datasheet is subject to change 42 1672 02 october 1996 applications n global positioning system (gps) receivers n car navigation systems n fleet management systems n time reference for telecom systems gps radio 12 channel gps low controller power real time clock/calendar 4k sram programmable memory interface ram rom/ flash st20-gp1 st20 cpu interrupt controller serial communications parallel input/output byte-wide parallel port . . . 6 8 2 uart (asc) 1 os-link . hardware dsp
contents 2/116 a 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 st20-gp1 architecture overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 digital signal processing module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1 dsp module registers ........................................................................................................ .................. 13 4 central processing unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.1 registers ................................................................................................................... ........................... 18 4.2 processes and concurrency ................................................................................................... ............. 19 4.3 priority .................................................................................................................... .............................. 21 4.4 process communications ...................................................................................................... ............... 21 4.5 timers ...................................................................................................................... ............................ 22 4.6 traps and exceptions ........................................................................................................ .................. 23 5 interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.1 interrupt vector table ...................................................................................................... ...................... 29 5.2 interrupt handlers .......................................................................................................... ....................... 29 5.3 interrupt latency ........................................................................................................... ........................ 30 5.4 pre-emption and interrupt priority .......................................................................................... .............. 30 5.5 restrictions on interrupt handlers .......................................................................................... .............. 30 5.6 interrupt configuration registers ........................................................................................... ................ 31 6 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 6.1 instruction cycles .......................................................................................................... ....................... 34 6.2 instruction characteristics ................................................................................................. ................... 35 6.3 instruction set tables ...................................................................................................... ...................... 36 7 memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 7.1 system memory use ........................................................................................................... ................. 45 7.2 boot rom .................................................................................................................... ........................ 46 7.3 internal peripheral space ................................................................................................... .................. 46 8 memory subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 8.1 sram ........................................................................................................................ .......................... 49 9 programmable memory interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 9.1 emi signal descriptions ..................................................................................................... ................... 51 9.2 strobe allocation ........................................................................................................... ....................... 52 9.3 external accesses ........................................................................................................... ..................... 52
st20-gp1 3/116 a 9.4 memwait ..................................................................................................................... ......................... 56 9.5 emi configuration registers ................................................................................................. ................. 58 9.6 reset and bootstrap behavior ................................................................................................ .............. 59 10 clocks and low power controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 10.1 clocks ..................................................................................................................... ............................. 61 10.2 low power control .......................................................................................................... ...................... 61 10.3 low power configuration registers .......................................................................................... ............. 63 10.4 clocking sources ........................................................................................................... ...................... 65 11 system services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 11.1 reset, initialization and debug ............................................................................................ ................. 67 11.2 bootstrap .................................................................................................................. ........................... 68 12 serial link interface (os-link) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 12.1 os-link protocol ........................................................................................................... ....................... 70 12.2 os-link speed .............................................................................................................. ....................... 70 12.3 os-link connections ........................................................................................................ .................... 71 13 uart interface (asc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 13.1 asynchronous serial controller operation ................................................................................... .......... 73 13.2 hardware error detection capabilities ...................................................................................... ............ 76 13.3 baud rate generation ....................................................................................................... .................... 76 13.4 interrupt control .......................................................................................................... .......................... 77 13.5 asc configuration registers ................................................................................................ ................. 79 14 parallel input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 14.1 pio port ................................................................................................................... ............................ 85 15 byte-wide parallel port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 15.1 emi mode operation ......................................................................................................... ................... 88 15.2 parallel link (dma) mode operation ......................................................................................... ............ 88 15.3 configuration registers .................................................................................................... ..................... 88 15.4 external data transfer protocols ........................................................................................... ................ 89 16 configuration register addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 17 electrical specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 18 gps performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 0 18.1 accuracy ................................................................................................................... ......................... 100 18.2 time to first fix .......................................................................................................... ......................... 101
st20-gp1 4/116 a 19 timing specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2 19.1 emi timings ................................................................................................................ ........................ 102 19.2 link timings ............................................................................................................... ......................... 104 19.3 reset and analyse timings .................................................................................................. .............. 105 19.4 clockin timings ............................................................................................................ ...................... 106 19.5 parallel port timings ...................................................................................................... ..................... 107 20 pin list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 21 package specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 21.1 st20-gp1 package pinout .................................................................................................... ............ 112 21.2 100 pin pqfp package dimensions ............................................................................................ ...... 113 22 device id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 23 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5
st20-gp1 5/116 a 1 introduction the st20-gp1 is an application-speci?c single chip micro using the st20 cpu with microprocessor style peripherals added on-chip. it incorporates dsp hardware for processing the signals from gps (global positioning system) satellites. the twelve channel gps correlation dsp hardware is designed to handle twelve satellites, two of which can be initialized to support the rtca-sc159 speci?cation for waas (wide area augmentation service) and egnos (european geostationary navigation overlay system) services. the st20-gp1 has been designed to minimize system costs and reduce the complexity of gps systems. it offers all hardware dsp and microprocessor functions on one chip. whilst the entire analogue section, rf and clock generation are available on a companion chip. thus, with the addition of a rom and a ram chip, a complete gps system is possible using just four chips, see figure 1.1. figure 1.1 gps system the st20-gp1 supports large values of frequency offset, allowing the use of a very low cost oscillator, thus saving the cost of a temperature controlled crystal oscillator (tcxo). the cpu and software have access to the part-processed signal to enable accelerated acquisition time. the st20-gp1 can implement the gps digital signal processing algorithms using less than 50% of the available cpu processing power. this leaves the rest available for integrating oem application functions such as route-?nding, map display and telemetry. a hardware microkernel in the st20 uart dsp asic radio antenna cpu real time clock watchdog ram rom low cost crystal st20-gp1 parallel i/o single chip no tcxo driver (optional) timer
st20-gp1 6/116 a cpu supports the sharing of cpu time between applications without an operating system or executive overhead. the architecture is based on the st20 cpu core and supporting macrocells developed by sgs- thomson microelectronics. the st20 micro-core family provides the tools and building blocks to enable the development of highly integrated application speci?c 32-bit devices at the lowest cost and fastest time to market. the st20 macrocell library includes the st20cx family of 32-bit vl- risc (variable length reduced instruction set computer) micro-cores, embedded memories, standard peripherals, i/o, controllers and asics. the st20-gp1 uses the st20 macrocell library to provide the hardware modules required in a gps system. these include: ? dsp hardware ? dual channel uart for serial communications ? 6 bits of parallel i/o ? interrupt controller ? real time clock/calendar ? watchdog timer the st20-gp1 is supported by a range of software and hardware development tools for pc and unix hosts including an ansi-c st20 software toolset and the st20 inquest window based debugging toolkit.
st20-gp1 7/116 a 2 st20-gp1 architecture overview the st20-gp1 consists of an st20 cpu plus application speci?c dsp hardware for handling gps signals, plus a dual channel uart, 8-bit parallel half-duplex link interface, 6-bit parallel io, real time clock and watchdog functions. figure 2.1 shows the subsystem modules that comprise the st20-gp1. these modules are outlined below and more detailed information is given in the following chapters. dsp the st20-gp1 includes dsp hardware for processing signals from the gps satellites. the dsp module generates the pseudo-random noise (prn) signals, and de-spreads the incoming signal. it consists of a down conversion stage that takes the 4 mhz input signal down to nominally zero frequency both in-phase and quadrature (i & q). this is followed by 12 parallel hardware channels for satellite tracking, whose output is passed to the cpu for further software processing at a programmable interval, nominally every millisecond. cpu the central processing unit (cpu) on the st20-gp1 is the st20 32-bit processor core. it contains instruction processing logic, instruction and data pointers, and an operand register. it directly accesses the high speed on-chip memory, which can store data or programs. the processor can access up to 4 mbytes of memory via the programmable memory interface.
st20-gp1 8/116 a figure 2.1 st20-gp1 architectural block diagram gps radio 12 channel gps low controller power real time clock 4k sram programmable memory interface ram rom/ flash st20-gp1 st20 cpu interrupt controller serial communications parallel input/output byte-wide parallel port . 2 uart 1 os-link hardware dsp system services os-link reset analyse error clock 6 interrupts user position output in ascii . . 8 . . .
st20-gp1 9/116 a memory subsystem the st20-gp1 on-chip memory system provides 130 mbytes/s internal data bandwidth, supporting pipelined 2-cycle internal memory access at 30 ns cycle times. the st20-gp1 memory system consists of sram and a programmable memory interface. the programmable memory interface is also referred to as an external memory interface (emi). the st20-gp1 uses 8 or 16-bit external ram, 8 or 16-bit rom, and supports an address width of 20 bits. the st20-gp1 product has 4 kbytes of on-chip sram. the advantage of this is the ability to store time critical code on chip, for instance interrupt routines, software kernels or device drivers, and even frequently used data. the st20-gp1 memory interface controls the movement of data between the st20-gp1 and off- chip memory. it is designed to support memory subsystems without any external support logic and is programmable to support a wide range of memory types. memory is divided into 4 banks which can each have different memory characteristics and each bank can access up to 1 mbyte of external memory. the normal memory provision in a simple gps receiver is a single 128k x 8-bit sram (55 or 70 ns access time), and a single 64k x 16-bit rom or flash rom (70, 90 or 100 ns access time). the st20-gp1 can support up to 1 mbyte of sram plus 1 mbyte of rom, enabling additional applications to be loaded if required. low power controller, real time clock and watchdog timer the st20-gp1 has power-down capabilities con?gurable in software. when powered down, a timer can be used as an alarm, re-activating the cpu after a programmed delay. this is suitable for ultra low power or solar powered applications such as container tracking, railway truck tracking, or marine navigation buoys that must check they are on station at intervals. the timer can also be used to provide a watchdog function, resetting the system if it times out. the real time clock/calendar function is provided by a 64-bit binary counter running continuously from the low-power clock (nominally 32768 hz). the st20-gp1 is designed for 0.5 micron, 3.3 v cmos technology and runs at speeds of up to 33 mhz. 3.3 v operation provides reduced power consumption internally and allows the use of low power peripherals. in addition, a power-down mode is available on the st20-gp1. the different power levels of the st20-gp1 are listed below. ? o perating power power consumed during functional operation. ? stand-by power power consumed during little or no activity. the cpu is idle but ready to immediately respond to an interrupt/reschedule. ? power-down clocks are stopped and power consumption is signi?cantly reduced. func- tional operation is stalled. normal functional operation can be resumed from previous state as soon as the clocks are stable. no information is lost during power down as all internal logic is static. ? power to most of the chip removed only the real time clock supply ( rtcvdd ) power on. in power-down mode the processor and all peripherals are stopped, including the external memory controller and optionally the pll. effectively the internal clock is stopped and functional operation is stalled. on restart the clock is restarted and the chip resumes normal functional operation.
st20-gp1 10/116 a serial communications the st20-gp1 has two uarts (asynchronous serial controllers (ascs)) for serial communication. the uarts provide an asynchronous serial interface and can be programmed to support a range of baud rates and data formats, for example, data size, stop bits and parity. there is one os-link on the st20-gp1 which acts as a dma engine independent of the cpu. the os-link uses an asynchronous bit-serial (byte-stream) protocol, each bit received is sampled ?ve times, hence the term oversampled link (os-link). the os-link provides a pair of channels, one input and one output channel. the link is used for: ? bootstrapping during development, ? debugging, ? communicating with os-link peripherals or other st20 devices. interrupt subsystem the st20-gp1 interrupt subsystem supports ?ve prioritized interrupts. three interrupts are connected to on-chip peripherals (2 for the uarts, 1 for the programmable io) and two are available as external interrupt pins. all interrupts are at a higher priority than the high priority process queue. each interrupt level has a higher priority than the previous and each level supports only one software handler process. note that interrupt handlers must not prevent the gps dsp data traf?c from being handled. during continuous operation this has 1 ms latency and is not a problem, but during initial acquisition it has a 32 m s rate and thus all interrupts must be disabled except if used to stop gps operation. byte-wide parallel port the byte-wide parallel port is provided to communicate with an external device. it transfers a byte at a time, operating half duplex in the program-selected direction. parallel io module six bits of parallel io are provided. each bit is programmable as an output or an input. edge detection logic is provided which can generate an interrupt on any change of an input bit. system services module the st20-gp1 system services module includes: ? reset, initialization and error port. ? phase locked loop (pll) accepts 16.368 mhz input and generates all the internal high frequency clocks needed for the cpu and the os-link.
st20-gp1 11/116 a 3 digital signal processing module the st20-gp1 chip includes 12 channel gps correlation dsp hardware. it is designed to handle twelve satellites, two of which can be initialized to support the rtca-sc159 speci?cation. the digital signal processing (dsp) module extracts gps data from the incoming if (intermediate frequency) data. there are a number of stages of processing involved; these are summarized below and in figure 3.1. after the 12 pairs of hardware correlators, the data for all channels are time division multiplexed onto the appropriate internal buses (i.e. values for each channel are passed in sequence, for example: i 1 , q 1 , i 2 , q 2 ... i 12 , q 12 , i 1 , q 1 ). figure 3.1 dsp module block diagram the main stages of processing are as follows: data sampling this stage removes any meta-stability caused by the asynchronous input data coming from an analogue source (the radio receiver). the data at this point consists of a carrier of nominally 4.092 mhz with a bandwidth of approximately 1 mhz. this stage is common to all 12 channels. frequency conversion (a) the ?rst frequency converter mixes the sampled if data with the (nominal) 4.092 mhz signal. this is done twice with a quarter cycle offset to produce i and q (in-phase and quadrature) versions of the data at nominal zero centre frequency (this can actually be up to 132 khz due to errors such i correlator (x 12) q correlator (x 12) frequency converter a frequency converter b accumulator st20 cpu accessible data sampler 4 mhz if input generator (x 12) numerically controlled oscillator registers pseudo random noise sequence dma interface
st20-gp1 12/116 a as doppler shift, crystal accuracy, etc.). the sum frequency (~8 mhz) is removed by low-pass ?ltering in the correlator. this stage is common to all 12 channels. correlation against pseudo-random sequence the gps data is transmitted as a spread-spectrum signal (with a bandwidth of about 2 mhz). in order to recover the data it is necessary to correlate against the same pseudo-random noise (prn) signal that was used to transmit the data. the output of the correlator accumulator is sampled at 264 khz. the prn sequences come from the prn generator. there is a correlator for the i and q signals for each of the 12 channels. the output signal is now narrowband. frequency conversion (b) the second stage of frequency conversion mixes the data with the local oscillator signal generated by the numerically controlled oscillator (nco). this signal is locked, under software control, to the space vehicle (sv) frequency and phase to remove the errors and take the frequency and bandwidth of the data down to 0 and 50 hz respectively. filtering to 500 hz is achieved in hardware, to 50 hz in software. this stage is shared by time division multiplexing between all 12 channels. this is loss-free as the stage supports 12 channels x 264 khz, approximately 3 mhz, well within its 16 mhz clock rate. result integration the ?nal stage sums the i and q values for each channel over a user de?ned period. in normal operation, the sampling period is slightly less than the 1ms length of the prn sequence. this ensures that no data is lost, although it may mean that some data samples are seen twice this is handled (mainly) in software. the sampling period can also be programmed to be much shorter (i.e. a higher cut-off frequency for the ?lter) when the system is trying to ?nd new satellites (acquisition mode). there are two further stages of buffering for the accumulated 16-bit i and q values for each channel. these allow for the slightly different time domains involved 1 . the results after hardware processing of the signal, using the parameters set in the dsp registers, refer to section 3.1, are delivered to the cpu via a dma engine in packet format. the cpu should perform an in (input) instruction on the appropriate channel (see address map, figure 7.1 on page 47) in order to read a packet. the format of the 62-byte packets is given in figure 3.2. these represent a two byte header, followed by the 16-bit i-values for 12 channels, then the 16-bit q-values for 12 channels, then the 8- bit timestamp values for the 12 channels. the i and q values are sent least signi?cant byte ?rst. the 2 byte header contains: a sync byte with the value #1b, and a sample rate byte which contains the two samplerate bits from the dspcontrol register, see table 3.1. packets are delivered at the rate selected by the dspcontrol register, even if new data is not available. in this case, the data value for the ?eld is set to #8000. this guarantees that synchronism 1. data sampled in sv time, data transmitted to the cpu at ?xed intervals.
st20-gp1 13/116 a is maintained between the satellite one-millisecond epochs and the receiver, despite time-of- reception variations due to the varying path length from the satellite. figure 3.2 dsp packet format 3.1 dsp module registers the gps hardware channels of the st20-gp1 are controlled by three sets of registers: 1 dspcontrol register 2 prncode0-11 and prnphase0-11 registers 3 ncofrequency0-11 and ncophase0-11 registers the base addresses for the dsp registers are given in the memory map chapter. dspcontrol register the dspcontrol register determines whether the prn generators are on (normal use) or disabled (for built-in-self-test of a system), whether the system is in tracking mode (840/970 m s output rate) or initial acquisition mode (31/62 m s), and selects which of the two rates for each mode. it also determines whether the accumulated carrier phase in the nco are reset to zero automatically or continue from their existing value. the bit allocations are given in table 3.1. 62 byte packet every 840/970/31/62 m s absent 16-bit values padded with #8000 12 x 8-bit time values 12 x 16-bit q values 12 x 16-bit i values 16-bit header sync sample rate acquisition mode first packet (in sv ms) t[7:6] = 10 t[5:0] = time[5:0] remaining packets t[7:6] = 00 t[5:0] = sequence number (sequence numbers are 2 to 16 or 32) tracking mode t[7:6] = 10 t[5:0] = time[5:0]
st20-gp1 14/116 a prncode0-11 registers the prncode0-11 registers choose the code for the particular satellite, and writing these causes a reset to the accumulated carrier phase in the nco for the corresponding channel, if enabled by the dspcontrol register. the bit-?elds for selecting particular gps satellites are given in table 3.3. dspcontrol dsp base address + #140 write only bit bit ?eld function 1:0 samplerate these bits control the sampling rate (the rate at which data is sent to the dma controller). the encoding of these bits is as follows: samplerate[1:0] transfer period no. of samples accumulated mode 00 840 m s 256 tracking 01 970 m s 256 10 31 m s 8 acquisition 11 62 m s16 2 ncoresetenable when set to 1, the accumulated nco phase for a channel is reset when the corre- sponding prn code register is written. 3 prndisable when set to 1, all prn generators are disabled. table 3.1 dspcontrol register format prncode0-11 dsp base address + #00 to #2c write only bit bit ?eld function 6:0 prncode satellite code as a 7-bit value. table 3.2 prncode0-11 register format satellite id prncode0-11 register value taps selected from g2 shift register a by bits 6 to 4 by bits 3 to 0 1 #62 6 2 2 #73 7 3 3 #04 8 4 4 #15 9 5 5 #11 9 1 6 #22 10 2 7 #01 8 1 8 #12 9 2 9 #23 10 3 10 #32 3 2 11 #43 4 3 12 #65 6 5 13 #76 7 6 14 #07 8 7 15 #18 9 8 table 3.3 prncode0-11 register value
st20-gp1 15/116 a for channels 0 and 1, rtca-sc159 satellite codes can also be selected. this is achieved by setting the prncode0-11 register appropriately and also writing the initial value for the satellite to the prninitialval0-1 register, see table 3.8. if uninitialized by the software, the prninitialval register defaults to 11 1111 1111 (#3ff) as required for gps satellites. the prncode0-11 and prninitialval0-1 registers are normally written only when the satellite is ?rst chosen. prnphase0-11 registers the prn0-11phase registers determine the relative delay between the receiver master clock, and the start of the one millisecond repetitive code sequence. the code sequence starts when the receiver clock counter (invisible to the software except through message timestamps) reaches the value written to the prnphase0-11 register. the prnphase0-11 register must only be written once per satellite milliseconds-epoch, which varies from the receiver epoch dynamically due to satellite motion. synchronism with the software is achieved by reading the register, when a write enable ?ag is returned. if not enabled, the write operation is abandoned by the software. a. refer to the us dod document icd-gps-200. b. it is the responsibility of the software to ensure that when this value is selected, a suitable value has been written into the prninitialval0-1 register. if this channel is later used for a standard gps sat- ellite, the prninitialval0-1 must be set to all ones (#3ff). 16 #29 10 9 17 #41 4 1 18 #52 5 2 19 #63 6 3 20 #74 7 4 21 #05 8 5 22 #16 9 6 23 #31 3 1 24 #64 6 4 25 #75 7 5 26 #06 8 6 27 #17 9 7 28 #28 10 8 29 #61 6 1 30 #72 7 2 31 #03 8 3 32 #14 9 4 - #25 10 5 - #24 10 4 - #71 7 1 - #02 8 2 - #24 10 4 waas b #20 10 0 satellite id prncode0-11 register value taps selected from g2 shift register a by bits 6 to 4 by bits 3 to 0 table 3.3 prncode0-11 register value
st20-gp1 16/116 a the 19-bit value comprises three ?elds. the 3 least signi?cant bits represent the fractional-delay in eighths of a code-chip. the middle 10 bits represent the integer delay in code-chips, 0-1022, with the value 1023 illegal. the upper 6 most signi?cant bits represent the delay in integer milliseconds. note also that the eighth-chip resolution of the code generator is not suf?cient for positioning. at 125 ns it represents approximately 40 m of range, over 100 m of position. the software must maintain the range measurements around the 1 ns resolution level in a 32-bit ?eld, and send an appropriate 19-bit sub-?eld to the register. note, care must be taken when calculating this ?eld from a computed delay, or vice versa, to allow for the missing value 1023. the overall register bit-?eld cannot be used mathematically as a single binary number. prnphase0-11wren registers the prnphase0-11wren ?ags are active low ?ags that record when the prnphase0-11 register can be updated. the prnphasewren ?ag for a channel is set high when the corresponding prnphase register is written. the ?ag is reset again when the value written is loaded into the prn generator. note, the prnphase0-11 register should only be updated when the prnphase0- 11wren register has been cleared by the hardware. ncofrequency0-11 registers the ncofrequency0-11 registers hold a signed 18-bit value that is added repetitively, ignoring over?ows, to the accumulated nco phase from which the nco sine and cosine waveforms are generated. the addition is performed at a 264 khz rate (16.368mhz/62). the accumulated nco phase is not accessible to the software, but can be cleared when initialising the channel if enabled by the dspcontrol register. each unit value in the ncofrequency0-11 register represents 264khz/(2 18 ), i.e. 1.007080078125 hz. if the extreme values are written, #1ffff and #20000, the sine wave generated will be at approximately +132 khz, and precisely -132 khz respectively. prnphase0-11 dsp base address + #40 to #6c write only bit bit ?eld function 2:0 fractionaldelay fractional delay in eighths of a code-chip. 12:3 integerdelay integer delay in code-chips. value 0-1022. note, the value 1023 is illegal. 18:13 delay delay in integer milliseconds. table 3.4 prnphase0-11 register format prnphase0-11wren dsp base address + #40 to #6c read only bit bit ?eld function 0 prnphasewren set when the corresponding prnphase0-11 register is set. table 3.5 prnphase0-11wren register format ncofrequency0-11 dsp base address + #80 to #ac write only bit bit ?eld function 17:0 ncofrequency nco frequency as a signed 18-bit value. table 3.6 ncofrequency0-11 register format
st20-gp1 17/116 a ncophase0-11 registers the ncophase0-11 registers contents are added to the accumulated phase to correct the carrier for the ?nal 1 hz that cannot be resolved by the nco frequency. this addition is not cumulative, and the value must be updated regularly by the software as a result of carrier phase errors measured on the satellite signal. the register holds a signed 7-bit ?eld representing +/-180 degrees total in steps of 2.8125 degrees (360/128). prninitialval0-1 registers the initial value for the two rtca-sc159 capable satellites channels should be written to the prninitialval0-1 registers. the value can be found in the rtca-sc159 specification . note : the value written to the register is the initial value de?ned by rtca-sc159 for the prn required. the conversion from big-endian as used in the speci?cation to little-endian as conventionally used in st20 architectures has been implemented in the hardware. if uninitialized by the software, this register defaults to 11 1111 1111 (#3ff) as required for gps satellites. ncophase0-11 dsp base address + #c4 to #ec write only bit bit ?eld function 6:0 ncophase nco phase as a signed 7-bit value representing +/-180 degrees total in steps of 2.8125 degrees (360/128). table 3.7 ncophase0-11 register format prninitialval0-1 dsp base address + #100, #104 write only bit bit ?eld function 9:0 initialvalue initial value of the rtca-sc159 satellite channel. table 3.8 prninitialval0-1 register format
st20-gp1 18/116 a 4 central processing unit the central processing unit (cpu) is the st20 32-bit processor core. it contains instruction processing logic, instruction and data pointers, and an operand register. it can directly access the high speed on-chip memory, which can store data or programs. where larger amounts of memory are required, the processor can access memory via the external memory interface (emi). the processor provides high performance: ? fast integer multiply 3 cycle multiply ? fast bit shift single cycle barrel shifter ? byte and part-word handling ? scheduling and interrupt support ? 64-bit integer arithmetic support the scheduler provides a single level of pre-emption. in addition, multi-level pre-emption is provided by the interrupt subsystem, see chapter 5 for details. additionally, there is a per-priority trap handler to improve the support for arithmetic errors and illegal instructions, refer to section 4.6. 4.1 registers the cpu contains six registers which are used in the execution of a sequential integer process. the six registers are: ? the workspace pointer ( wptr ) which points to an area of store where local data is kept. ? the instruction pointer ( iptrreg ) which points to the next instruction to be executed. ? the status register ( statusreg ). ? the areg , breg and creg registers which form an evaluation stack. the areg , breg and creg registers are the sources and destinations for most arithmetic and logical operations. loading a value into the stack pushes breg into creg , and areg into breg , before loading areg . storing a value from areg , pops breg into areg and creg into breg . creg is left unde?ned. figure 4.1 registers used in sequential integer processes areg breg creg wptr iptrreg local data program registers
st20-gp1 19/116 a expressions are evaluated on the evaluation stack, and instructions refer to the stack implicitly. for example, the add instruction adds the top two values in the stack and places the result on the top of the stack. the use of a stack removes the need for instructions to explicitly specify the location of their operands. no hardware mechanism is provided to detect that more than three values have been loaded onto the stack; it is easy for the compiler to ensure that this never happens. note that a location in memory can be accessed relative to the workspace pointer, enabling the workspace to be of any size. the use of shadow registers provides fast, simple and clean context switching. 4.2 processes and concurrency the following section describes default behavior of the cpu and it should be noted that the user can alter this behavior, for example, by disabling timeslicing, installing a user scheduler, etc. a process starts, performs a number of actions, and then either stops without completing or terminates complete. typically, a process is a sequence of instructions. the cpu can run several processes in parallel (concurrently). processes may be assigned either high or low priority, and there may be any number of each. the processor has a microcoded scheduler which enables any number of concurrent processes to be executed together, sharing the processor time. this removes the need for a software kernel, although kernels can still be written if desired. at any time, a process may be active - being executed - interrupted by a higher priority process - on a list waiting to be executed inactive - waiting to input - waiting to output - waiting until a speci?ed time the scheduler operates in such a way that inactive processes do not consume any processor time. each active high priority process executes until it becomes inactive. the scheduler allocates a portion of the processors time to each active low priority process in turn (see section 4.3). active processes waiting to be executed are held in two linked lists of process workspaces, one of high priority processes and one of low priority processes. each list is implemented using two registers, one of which points to the ?rst process in the list, the other to the last. in the linked process list shown in figure 4.2, process s is executing and p , q and r are active, awaiting execution. only the low priority process queue registers are shown; the high priority process ones behave in a similar manner.
st20-gp1 20/116 a figure 4.2 linked process list each process runs until it has completed its action or is descheduled. in order for several processes to operate in parallel, a low priority process is only permitted to execute for a maximum of two timeslice periods. after this, the machine deschedules the current process at the next timeslicing point, adds it to the end of the low priority scheduling list and instead executes the next active process. the timeslice period is 1ms. there are only certain instructions at which a process may be descheduled. these are known as descheduling points. a process may only be timesliced at certain descheduling points. these are known as timeslicing points and are de?ned in such a way that the operand stack is always empty. this removes the need for saving the operand stack when timeslicing. as a result, an expression evaluation can be guaranteed to execute without the process being timesliced part way through. whenever a process is unable to proceed, its instruction pointer is saved in the process workspace and the next process taken from the list. the processor core provides a number of special instructions to support the process model, including startp (start process) and endp (end process). when a main process executes a parallel construct, startp is used to create the necessary additional concurrent processes. a startp instruction creates a new process by adding a new workspace to the end of the scheduling list, enabling the new concurrent process to be executed together with the ones already being executed. when a process is made active it is always added to the end of the list, and thus cannot pre-empt processes already on the same list. the correct termination of a parallel construct is assured by use of the endp instruction. this uses a data structure that includes a counter of the parallel construct components which have still to terminate. the counter is initialized to the number of components before the processes are started. each component ends with an endp instruction which decrements and tests the counter. for all but function high priority low priority pointer to front of active process list fptrreg0 fptrreg1 pointer to back of active process list bptrreg0 bptrreg1 table 4.1 priority queue control registers p q r s fptrreg1 local data registers program bptrreg1 pw.iptr pw.link pw.iptr pw.link pw.iptr wptr iptrreg areg breg creg
st20-gp1 21/116 a the last component, the counter is non zero and the component is descheduled. for the last component, the counter is zero and the main process continues. 4.3 priority the following section describes default behavior of the cpu and it should be noted that the user can alter this behavior, for example, by disabling timeslicing and priority interrupts. the processor can execute processes at one of two priority levels, one level for urgent (high priority) processes, one for less urgent (low priority) processes. a high priority process will always execute in preference to a low priority process if both are able to do so. high priority processes are expected to execute for a short time. if one or more high priority processes are active, then the ?rst on the queue is selected and executes until it has to wait for a communication, a timer input, or until it completes processing. if no process at high priority is active, but one or more processes at low priority are active, then one is selected. low priority processes are periodically timesliced to provide an even distribution of processor time between computationally intensive tasks. if there are n low priority processes, then the maximum latency from the time at which a low priority process becomes active to the time when it starts processing is the order of 2 n timeslice periods. it is then able to execute for between one and two timeslice periods, less any time taken by high priority processes. this assumes that no process monopolizes the cpus time; i.e. it has frequent timeslicing points. the speci?c condition for a high priority process to start execution is that the cpu is idle or running at low priority and the high priority queue is non-empty. if a high priority process becomes able to run whilst a low priority process is executing, the low priority process is temporarily stopped and the high priority process is executed. the state of the low priority process is saved into shadow registers and the high priority process is executed. when no further high priority processes are able to run, the state of the interrupted low priority process is re-loaded from the shadow registers and the interrupted low priority process continues executing. instructions are provided on the processor core to allow a high priority process to store the shadow registers to memory and to load them from memory. instructions are also provided to allow a process to exchange an alternative process queue for either priority process queue (see table 6.21 on page 43). these instructions allow extensions to be made to the scheduler for custom runtime kernels. a low priority process may be interrupted after it has completed execution of any instruction. in addition, to minimize the time taken for an interrupting high priority process to start executing, the potentially time consuming instructions are interruptible. also some instructions are abortable and are restarted when the process next becomes active (refer to the instruction set chapter). 4.4 process communications communication between processes takes place over channels, and is implemented in hardware. communication is point-to-point, synchronized and unbuffered. as a result, a channel needs no process queue, no message queue and no message buffer. a channel between two processes executing on the same cpu is implemented by a single word in memory; a channel between processes executing on different processors is implemented by point-
st20-gp1 22/116 a to-point links. the processor provides a number of operations to support message passing, the most important being in (input message) and out (output message). the in and out instructions use the address of the channel to determine whether the channel is internal or external. this means that the same instruction sequence can be used for both hard and soft channels, allowing a process to be written and compiled without knowledge of where its channels are implemented. communication takes place when both the inputting and outputting processes are ready. consequently, the process which ?rst becomes ready must wait until the second one is also ready. the inputting and outputting processes only become active when the communication has completed. a process performs an input or output by loading the evaluation stack with, a pointer to a message, the address of a channel, and a count of the number of bytes to be transferred, and then executing an in or out instruction. 4.5 timers there are two 32-bit hardware timer clocks which tick periodically. these are independent of any on-chip peripheral real time clock. the timers provide accurate process timing, allowing processes to deschedule themselves until a speci?c time. one timer is accessible only to high priority processes and is incremented every microsecond, cycling completely in approximately 4295 seconds. the other is accessible only to low priority processes and is incremented every 64 microseconds, giving 15625 ticks in one second. it has a full period of approximately 76 hours. all times are approximate due to the clock rate. the current value of the processor clock can be read by executing a ldtimer (load timer) instruction. a process can arrange to perform a tin (timer input), in which case it will become ready to execute after a speci?ed time has been reached. the tin instruction requires a time to be speci?ed. if this time is in the past then the instruction has no effect. if the time is in the future then the process is descheduled. when the speci?ed time is reached the process becomes active. in addition, the ldclock (load clock), stclock (store clock) instructions allow total control over the clock value and the clockenb (clock enable), clockdis (clock disable) instructions allow each clock to be individually stopped and re-started. figure 4.3 shows two processes waiting on the timer queue, one waiting for time 21, the other for time 31. note, these timers stop counting when power-down mode (see section 10.2 on page 61) is invoked. register function clockreg0 current value of high priority (level 0) process clock clockreg1 current value of low priority (level 1) process clock tnextreg0 indicates time of earliest event on high priority (level 0) timer queue tnextreg1 indicates time of earliest event on low priority (level 1) timer queue tptrreg0 high priority timer queue tptrreg1 low priority timer queue table 4.2 timer registers
st20-gp1 23/116 a figure 4.3 timer registers 4.6 traps and exceptions a software error, such as arithmetic over?ow or array bounds violation, can cause an error ?ag to be set in the cpu. the ?ag is directly connected to the errorout pin. both the ?ag and the pin can be ignored, or the cpu stopped. stopping the cpu on an error means that the error cannot cause further corruption. as well as containing the error in this way it is possible to determine the state of the cpu and its memory at the time the error occurred. this is particularly useful for postmortem debugging where the debugger can be used to examine the state and history of the processor leading up to and causing the error condition. in addition, if a trap handler process is installed, a variety of traps/exceptions can be trapped and handled by software. a user supplied trap handler routine can be provided for each high/low process priority level. the handler is started when a trap occurs and is given the reason for the trap. the trap handler is not re-entrant and must not cause a trap itself within the same group. all traps are individually maskable. 4.6.1 trap groups the trap mechanism is arranged on a per priority basis. for each priority there is a handler for each group of traps, as shown in figure 4.4. clockreg0 tnextreg0 tptrreg0 workspaces program 5 21 31 empty comparator alarm 21
st20-gp1 24/116 a figure 4.4 trap arrangement there are four groups of traps, as detailed below. ? breakpoint this group consists of the breakpoint trap. the breakpoint instruction ( j0 ) calls the break- point routine via the trap mechanism. ? errors the traps in this group are integererror and overflow . overflow represents arithmetic over- ?ow, such as arithmetic results which do not ?t in the result word. integererror represents errors caused when data is erroneous, for example when a range checking instruction ?nds that data is out of range. ? system operations this group consists of the loadtrap , storetrap and illegalopcode traps. the illegalopcode trap is signalled when an attempt is made to execute an illegal instruction. the loadtrap and storetrap traps allow a kernel to intercept attempts by a monitored process to change or examine trap handlers or trapped process information. it enables a user program to sig- nal to a kernel that it wishes to install a new trap handler. ? scheduler the scheduler trap group consists of the externalchannel, internalchannel, timer, times- lice, run, signal, processinterrupt and queueempty traps. the processinterrupt trap sig- nals that the machine has performed a priority interrupt from low to high. the queueempty trap indicates that there is no further executable work to perform. the other traps in this group indicate that the hardware scheduler wants to schedule a process on a process queue, with the different traps enabling the different sources of this to be monitored. the scheduler traps enable a software scheduler kernel to use the hardware scheduler to implement a multi-priority software scheduler. note that scheduler traps are different from other traps as they are caused by the micro- scheduler rather than by an executing process. note, when the scheduler trap is caused by a process that is ready to be scheduled, the wptr of that process is stored in the workspace of the scheduler trap handler, at address 0. the trap handler can access this using a ldl 0 instruction. low priority traps high priority traps breakpoint trap handler cpu error trap handler system operations trap handler scheduler trap handler breakpoint trap handler cpu error trap handler system operations trap handler scheduler trap handler
st20-gp1 25/116 a trap groups encoding is shown in table 4.4 below. these codes are used to identify trap groups to various instructions. in addition to the trap groups mentioned above, the causeerror ?ag in the status register is used to signal when a trap condition has been activated by the causeerror instruction. it can be used to indicate when trap conditions have occurred due to the user setting them, rather than by the system. 4.6.2 events that can cause traps table 4.4 summarizes the events that can cause traps and gives the encoding of bits in the trap status and enable words. trap group code breakpoint 0 cpu errors 1 system operations 2 scheduler 3 table 4.3 trap group codes trap cause status/enable codes trap group comments breakpoint 0 0 when a process executes the breakpoint instruction ( j0 ) then it traps to its trap handler. integererror 1 1 integer error other than integer over?ow C e.g. explicitly checked or explicitly set error. overflow 2 1 integer over?ow or integer division by zero. illegalopcode 3 2 attempt to execute an illegal instruction. this is signalled when opr (operate) is executed with an invalid operand. loadtrap 4 2 when the trap descriptor is read with the ldtraph (load trap handler) instruction or when the trapped process status is read with the ldtrapped (load trapped) instruction. storetrap 5 2 when the trap descriptor is written with the sttraph (store trap handler) instruction or when the trapped process status is written with the sttrapped (store trapped) instruction. internalchannel 6 3 scheduler trap from internal channel. externalchannel 7 3 scheduler trap from external channel. timer 8 3 scheduler trap from timer alarm. timeslice 9 3 scheduler trap from timeslice. run 10 3 scheduler trap from runp (run process) or startp (start process). signal 11 3 scheduler trap from signal . processinterrupt 12 3 start executing a process at a new priority level. queueempty 13 3 caused by no process active at a priority level. causeerror 15 (status only) any, encoded 0-3 signals that the causeerror instruction set the trap ?ag. table 4.4 trap causes and status / enable codes
st20-gp1 26/116 a 4.6.3 trap handlers for each trap handler there is a trap handler structure and a trapped process structure. both the trap handler structure and the trapped process structure are in memory and can be accessed via instructions, see section 4.6.4. the trap handler structure speci?es what should happen when a trap condition is present, see table 4.6. the trapped process structure saves some of the state of the process that was running when the trap was taken, see table 4.7. in addition, for each priority, there is an enables register and a status register. the enables register contains ?ags to enable each cause of trap. the status register contains ?ags to indicate which trap conditions have been detected. the enables and status register bit encodings are given in table 4.4. a trap will be taken at an interruptible point if a trap is set and the corresponding trap enable bit is set in the enables register. if the trap is not enabled then nothing is done with the trap condition. if the trap is enabled then the corresponding bit is set in the status register to indicate the trap condition has occurred. when a process takes a trap the processor saves the existing iptr , wptr , status and enables in the trapped process structure. it then loads iptr , wptr and status from the equivalent trap handler structure and ands the value in enables with the value in the structure. this allows the user to disable various events while in the handler, in particular a trap handler must disable all the traps of its trap group to avoid the possibility of a handler trapping to itself. the trap handler then executes. the values in the trapped process structure can be examined using the ldtrapped instruction (see section 4.6.4). when the trap handler has completed its operation it returns to the trapped process via the tret (trap return) instruction. this reloads the values saved in the trapped process structure and clears the trap ?ag in status . note that when a trap handler is started, areg , breg and creg are not saved. the trap handler must save the areg , breg , creg registers using stl (store local). comments iptr iptr of trap handler process. base + 3 wptr wptr of trap handler process. base + 2 status contains the status register that the trap handler starts with. base + 1 enables contains a word which encodes the trap enable and global interrupt masks which will be anded with the existing masks to allow the trap handler to disable various events while it runs. base + 0 table 4.5 trap handler structure comments iptr points to the instruction after the one that caused the trap condition. base + 3 wptr wptr of the process that was running when the trap was taken. base + 2 status the relevant trap bit is set, see table 4.5 for trap codes. base + 1 enables interrupt enables. base + 0 table 4.6 trapped process structure
st20-gp1 27/116 a 4.6.4 trap instructions trap handlers and trapped processes can be set up and examined via the ldtraph , sttraph , ldtrapped and sttrapped instructions. table 4.8 describes the instructions that may be used when dealing with traps. the ?rst four instructions transfer data to/from the trap handler structures or trapped process structures from/to an area in memory. in these instructions areg contains the trap group code (see table 4.4) and breg points to the 4 word area of memory used as the source or destination of the transfer. in addition creg contains the priority of the handler to be installed/examined in the case of ldtraph or sttraph. ldtrapped and sttrapped apply only to the current priority. if the loadtrap trap is enabled then ldtraph and ldtrapped do not perform the transfer but set the loadtrap trap ?ag. if the storetrap trap is enabled then sttraph and sttrapped do not perform the transfer but set the storetrap trap ?ag. the trap enable masks are encoded by an array of bits (see table 4.5) which are set to indicate which traps are enabled. this array of bits is stored in the lower half-word of the enables register. there is an enables register for each priority. traps are enabled or disabled by loading a mask into areg with bits set to indicate which traps are to be affected and the priority to affect in breg . executing trapenb ors the mask supplied in areg with the trap enables mask in the enables register for the priority in breg . executing trapdis negates the mask supplied in areg and ands it with the trap enables mask in the enables register for the priority in breg . both instructions return the previous value of the trap enables mask in areg . 4.6.5 restrictions on trap handlers there are various restrictions that must be placed on trap handlers to ensure that they work correctly. 1 trap handlers must not deschedule or timeslice. trap handlers alter the enables masks, therefore they must not allow other processes to execute until they have completed. 2 trap handlers must have their enable masks set to mask all traps in their trap group to avoid the possibility of a trap handler trapping to itself. 3 trap handlers must terminate via the tret (trap return) instruction . the only exception to this is that a scheduler kernel may use restart to return to a previously shadowed process. instruction meaning use ldtraph load trap handler load the trap handler from memory to the trap handler descriptor sttraph store trap handler store an existing trap handler descriptor to memory ldtrapped load trapped load replacement trapped process status from memory sttrapped store trapped store trapped process status to memory trapenb trap enable enable traps trapdis trap disable disable traps tret trap return used to return from a trap handler causeerror cause error program can simulate the occurrence of an error table 4.7 instructions which may be used when dealing with traps
st20-gp1 28/116 a 5 interrupt controller the st20-gp1 supports external interrupts, enabling an on-chip subsystem or external interrupt pin to interrupt the currently running process in order to run an interrupt handling process. the st20-gp1 interrupt subsystem supports ?ve prioritized interrupts. this allows nested pre- emptive interrupts for real-time system design. three interrupts are connected to on-chip peripherals (2 for the uarts, 1 for the programmable io) and two are available as external interrupt pins. all interrupts are at a higher priority than the high priority process queue, see figure 5.1. each interrupt level has a higher priority than the previous (interrupt 0 is lowest priority) and each level supports only one software handler process.note that interrupt handlers must not prevent the gps dsp data traf?c from being handled. during continuous operation this has 1 ms latency and is not a problem, but during initial acquisition it has a 32 m s rate and thus all interrupts must be disabled except if used to stop gps operation. figure 5.1 interrupt priority interrupts on the st20-gp1 are implemented via an on-chip interrupt controller peripheral. an interrupt can be signalled to the controller by one of the following: ? a signal on an external interrupt pin ? a signal from an internal peripheral or subsystem ? software asserting an interrupt in a bit mask interrupt 3 interrupt 1 interrupt 0 high priority low priority increasing pre-emption process process programmable io uart0 interrupt 2 uart1 interrupt0 pin interrupt 4 interrupt1 pin
st20-gp1 29/116 a 5.1 interrupt vector table the interrupt controller contains a table of pointers to interrupt handlers. each interrupt handler is represented by its workspace pointer ( wptr ). the table contains a workspace pointer for each level of interrupt. the wptr gives access to the code, data and interrupt save space of the interrupt handler. the position of the wptr in the interrupt table implies the priority of the interrupt. run-time library support is provided for setting and programming the vector table. 5.2 interrupt handlers at any interruptible point in its execution the cpu can receive an interrupt request from the interrupt controller. the cpu immediately acknowledges the request. in response to receiving an interrupt the cpu performs a procedure call to the process in the vector table. the state of the interrupted process is stored in the workspace of the interrupt handler as shown in figure 5.2. each interrupt level has its own workspace. figure 5.2 state of interrupted process the interrupt routine is initialized with space below wptr . the iptr and status word for the routine are stored there permanently. this should be programmed before the wptr is written into the vector table. the behavior of the interrupt differs depending on the priority of the cpu when the interrupt occurs. when an interrupt occurs when the cpu was running at high priority, the cpu saves the current process state ( areg , breg , creg , wptr , iptr and status ) into the workspace of the interrupt handler. the value handlerwptr , which is stored in the interrupt controller, points to the top of this handler status before interrupt wptr handler iptr areg breg creg interrupting high priority wptr wptr iptr status wptr null status process interrupting low priority process or cpu idle handler status handler iptr handler status handler iptr
st20-gp1 30/116 a workspace. the values of iptr and status to be used by the interrupt handler are loaded from this workspace and starts executing the handler. the value of wptr is then set to the bottom of this save area. when an interrupt occurs when the cpu was idle or running at low priority, the status is saved. this indicates that no valid process is running ( null status ). the interrupted processes (low priority process) state is stored in shadow registers. this state can be accessed via the ldshadow (load shadow registers) and stshadow (store shadow registers) instructions. the interrupt handler is then run at high priority. when the interrupt routine has completed it must adjust wptr to the value at the start of the handler code and then execute the iret (interrupt return) instruction. this restores the interrupted state from the interrupt handler structure and signals to the interrupt controller that the interrupt has completed. the processor will then continue from where it was before being interrupted. 5.3 interrupt latency the interrupt latency is dependent on the data being accessed and the position of the interrupt handler and the interrupted process. this allows systems to be designed with the best trade-off use of fast internal memory and interrupt latency. 5.4 pre-emption and interrupt priority each interrupt channel has an implied priority ?xed by its place in the interrupt vector table. all interrupts will cause scheduled processes of any priority to be suspended and the interrupt handler started. once an interrupt has been sent from the controller to the cpu the controller keeps a record of the current executing interrupt priority. this is only cleared when the interrupt handler executes a return from interrupt ( iret ) instruction. interrupts of a lower priority arriving will be blocked by the interrupt controller until the interrupt priority has descended to such a level that the routine will execute. an interrupt of a higher priority than the currently executing handler will be passed to the cpu and cause the current handler to be suspended until the higher priority interrupt is serviced. in this way interrupts can be nested and a higher priority interrupt will always pre-empt a lower priority one. deep nesting and placing frequent interrupts at high priority can result in a system where low priority interrupts are never serviced or the controller and cpu time are consumed in nesting interrupt priorities and not executing the interrupt handlers. 5.5 restrictions on interrupt handlers there are various restrictions that must be placed on interrupt handlers to ensure that they interact correctly with the rest of the process model implemented in the cpu. 1 interrupt handlers must not deschedule. 2 interrupt handlers must not execute communication instructions. however they may com- municate with other processes through shared variables using the semaphore signal to synchronize. 3 interrupt handlers must not perform block move instructions. 4 interrupt handlers must not cause program traps. however they may be trapped by a scheduler trap.
st20-gp1 31/116 a 5.6 interrupt con?guration registers the interrupt controller is allocated a 4k block of memory in the internal peripheral address space. information on interrupts is stored in registers as detailed in the following section. the registers can be examined and set by the devlw (device load word) and devsw (device store word) instructions. note, they can not be accessed using memory instructions. handlerwptr register the handlerwptr registers (1 per interrupt) contain a pointer to the workspace of the interrupt handler. note, before the interrupt is enabled, by writing a 1 in the mask register, the user (or toolset) must ensure that there is a valid wptr in the register. triggermode register each interrupt channel can be programmed to trigger on rising/falling edges or high/low levels on the external interrupt . note, level triggering is different to edge triggering in that if the input is held at the triggering level, a continuous stream of interrupts is generated. mask register an interrupt mask register is provided in the interrupt controller to selectively enable or disable external interrupts. this mask register also includes a global interrupt disable bit to disable all external interrupts whatever the state of the individual interrupt mask bits. to complement this the interrupt controller also includes an interrupt pending register which contains a pending ?ag for each interrupt channel. the mask register performs a masking function on the pending register to give control over what is allowed to interrupt the cpu while retaining the ability to continually monitor external interrupts. handlerwptr0-4 interrupt controller base address + #00 to #10 read/write bit bit field function 31:2 handlerwptr pointer to the workspace of the interrupt handler. 1:0 reserved. write 0. table 5.1 handlerwptr register format one register per interrupt triggermode0-4 interrupt controller base address + #40 to #50 read/write bit bit field function 2:0 trigger control the triggering condition of the interrupt , as follows: trigger2:0 interrupt triggers on 000 no trigger mode 001 high level - triggered while input high 010 low level - triggered while input low 011 rising edge - low to high transition 100 falling edge - high to low transition 101 any edge - triggered on rising and falling edges 110 no trigger mode 111 no trigger mode table 5.2 triggermode register format one register per interrupt
st20-gp1 32/116 a on start-up, the mask register is initialized to zeros, thus all interrupts are disabled, both globally and individually. when a 1 is written to the globalenable bit, the individual interrupt bits are still disabled and must also have a 1 individually written to the interruptenable bit to enable the respective interrupt. the mask register is mapped onto two additional addresses so that bits can be set or cleared individually. set_mask (address interrupt base address + #c4) allows bits to be set individually. writing a 1 in this register sets the corresponding bit in the mask register, a 0 leaves the bit unchanged. clear_mask (address interrupt base address + #c8) allows bits to be cleared individually. writing a 1 in this register resets the corresponding bit in the mask register, a 0 leaves the bit unchanged. pending register the pending register contains a bit per interrupt with each bit controlled by the corresponding interrupt. a read can be used to examine the state of the interrupt controller while a write can be used to explicitly trigger an interrupt. a bit is set when the triggering condition for an interrupt is met. all bits are independent so that several bits can be set in the same cycle. once a bit is set, a further triggering condition will have no effect. the triggering condition is independent of the mask register. the highest priority interrupt bit is reset once the interrupt controller has made an interrupt request to the cpu. mask interrupt controller base address + #c0 read/write bit bit field function 0 interrupt0enable when set to 1, interrupt 0 is enabled. when 0, interrupt 0 is disabled. 1 interrupt1enable when set to 1, interrupt 1 is enabled. when 0, interrupt 1 is disabled. 2 interrupt2enable when set to 1, interrupt 2 is enabled. when 0, interrupt 2 is disabled. 3 interrupt3enable when set to 1, interrupt 3 is enabled. when 0, interrupt 3 is disabled. 4 interrupt4enable when set to 1, interrupt 4 is enabled. when 0, interrupt 4 is disabled. 16 globalenable when set to 1, the setting of the interrupt is determined by the speci?c interrupten- able bit. when 0, all interrupts are disabled. 15:5 reserved. write 0. table 5.3 mask register format
st20-gp1 33/116 a the interrupt controller receives external interrupt requests and makes an interrupt request to the cpu when it has a pending interrupt request of higher priority than the currently executing interrupt handler. the pending register is mapped onto two additional addresses so that bits can be set or cleared individually. set_pending (address interrupt base address + #84) allows bits to be set individually. writing a 1 in this register sets the corresponding bit in the pending register, a 0 leaves the bit unchanged. clear_pending (address interrupt base address + #88) allows bits to be cleared individually. writing a 1 in this register resets the corresponding bit in the pending register, a 0 leaves the bit unchanged. note, if the cpu wants to write or clear some bits of the pending register, the interrupts should be masked (by writing or clearing the mask register) before writing or clearing the pending register. the interrupts can then be unmasked. exec register the exec register keeps track of the currently executing and pre-empted interrupts. a bit is set when the cpu starts running code for that interrupt. the highest priority interrupt bit is reset once the interrupt handler executes a return from interrupt ( iret ). the exec register is mapped onto two additional addresses so that bits can be set or cleared individually. set_exec (address interrupt base address + #104) allows bits to be set individually. writing a 1 in this register sets the corresponding bit in the exec register, a 0 leaves the bit unchanged. clear_exec (address interrupt base address + #108) allows bits to be cleared individually. writing a 1 in this register resets the corresponding bit in the exec register, a 0 leaves the bit unchanged. pending interrupt controller base address + #80 read/write bit bit field function 0 pendingint0 interrupt 0 pending bit. 1 pendingint1 interrupt 1 pending bit. 2 pendingint2 interrupt 2 pending bit. 3 pendingint3 interrupt 3 pending bit. 4 pendingint4 interrupt 4 pending bit. table 5.4 pending register format exec interrupt controller base address + #100 read/write bit bit field function 0 interrupt0exec set to 1 when the cpu starts running code for interrupt 0. 1 interrupt1exec set to 1 when the cpu starts running code for interrupt 1. 2 interrupt2exec set to 1 when the cpu starts running code for interrupt 2. 3 interrupt3exec set to 1 when the cpu starts running code for interrupt 3. 4 interrupt4exec set to 1 when the cpu starts running code for interrupt 4. table 5.5 exec register format
st20-gp1 34/116 a 6 instruction set this chapter provides information on the instruction set. it contains tables listing all the instructions, and where applicable provides details of the number of processor cycles taken by an instruction. the instruction set has been designed for simple and ef?cient compilation of high-level languages. all instructions have the same format, designed to give a compact representation of the operations occurring most frequently in programs. each instruction consists of a single byte divided into two 4-bit parts. the four most signi?cant bits (msb) of the byte are a function code and the four least signi?cant bits (lsb) are a data value, as shown in figure 6.1. figure 6.1 instruction format for further information on the instruction set refer to the st20 instruction set manual (document number 72-trn-273-01). 6.1 instruction cycles timing information is available for some instructions. however, it should be noted that many instructions have ranges of timings which are data dependent. where included, timing information is based on the number of clock cycles assuming any memory accesses are to 2 cycle internal memory and no other subsystem is using memory. actual time will be dependent on the speed of external memory and memory bus availability. note that the actual time can be increased by: 1 the instruction requiring a value on the register stack from the ?nal memory read in the pre- vious instruction the current instruction will stall until the value becomes available. 2 the ?rst memory operation in the current instruction can be delayed while a preceding memory operation completes any two memory operations can be in progress at any time, any further operation will stall until the ?rst completes. 3 memory operations in current instructions can be delayed by access by instruction fetch or subsystems to the memory interface. 4 there can be a delay between instructions while the instruction fetch unit fetches and par- tially decodes the next instruction this will be the case whenever an instruction causes the instruction ?ow to jump. note that the instruction timings given refer to standard behavior and may be different if, for example, traps are set by the instruction. function data 7430
st20-gp1 35/116 a 6.2 instruction characteristics the primary instructions table 6.3 gives the basic function code. where the operand is less than 16, a single byte encodes the complete instruction. if the operand is greater than 15, one pre?x instruction ( p?x ) is required for each additional four bits of the operand. if the operand is negative the ?rst pre?x instruction will be n?x . examples of p?x and n?x coding are given in table 6.1. any instruction which is not in the instruction set tables is an invalid instruction and is ?agged illegal, returning an error code to the trap handler, if loaded and enabled. the notes column of the tables indicates the descheduling and error features of an instruction as described in table 6.2 . mnemonic function code memory code ldc #3 #4 #43 ldc #35 is coded as p?x #3 #2 #23 ldc #5 #4 #45 ldc #987 is coded as p?x #9 #2 #29 p?x #8 #2 #28 ldc #7 #4 #47 ldc -31 ( ldc #ffffffe1) is coded as n?x #1 #6 #61 ldc #1 #4 #41 table 6.1 pre?x coding ident feature e instruction can set an integererror trap l instruction can cause a loadtrap trap s instruction can cause a storetrap trap o instruction can cause an over?ow trap i interruptible instruction a instruction can be aborted and later restarted. d instruction can deschedule t instruction can timeslice table 6.2 instruction features
st20-gp1 36/116 a 6.3 instruction set tables function code memory code mnemonic processor cycles name notes 0 0x j 7 jump d, t 1 1x ldlp 1 load local pointer 2 2x p?x 0 to 3 pre?x 3 3x ldnl 1 load non-local 4 4x ldc 1 load constant 5 5x ldnlp 1 load non-local pointer 6 6x n?x 0 to 3 negative pre?x 7 7x ldl 1 load local 8 8x adc 2 to 3 add constant o 9 9x call 8 call a ax cj 1 or 7 conditional jump b bx ajw 2 adjust workspace c cx eqc 1 equals constant d dx stl 1 store local e ex stnl 2 store non-local f fx opr 0 operate table 6.3 primary functions memory code mnemonic processor cycles name notes 22fa testpranal 1 test processor analyzing 23fe saveh 3 save high priority queue registers 23fd savel 3 save low priority queue registers 21f8 sthf 1 store high priority front pointer 25f0 sthb 1 store high priority back pointer 21fc stlf 1 store low priority front pointer 21f7 stlb 1 store low priority back pointer 25f4 sttimer 2 store timer 2127fc lddevid 1 load device identity? 27fe ldmemstartval 1 load value of memstart address ?see section 22 table 6.4 processor initialization operation codes
st20-gp1 37/116 a memory code mnemonic processor cycles name notes 24f6 and 1 and 24fb or 1 or 23f3 xor 1 exclusive or 23f2 not 1 bitwise not 24f1 shl 1 shift left 24f0 shr 1 shift right f5 add 2 add a, o fc sub 2 subtract a, o 25f3 mul 3 multiply a, o 27f2 fmul 5 fractional multiply a, o 22fc div 4 to 35 divide a, o 21ff rem 3 to 35 remainder a, o f9 gt 2 greater than a 25ff gtu 2 greater than unsigned a f4 diff 1 difference 25f2 sum 1 sum f8 prod 3 product a 26f8 satadd 2 to 3 saturating add a 26f9 satsub 2 to 3 saturating subtract a 26fa satmul 4 saturating multiply a table 6.5 arithmetic/logical operation codes
st20-gp1 38/116 a memory code mnemonic processor cycles name notes 21f6 ladd 2 long add a, o 23f8 lsub 2 long subtract a, o 23f7 lsum 1 long sum 24ff ldiff 1 long diff 23f1 lmul 4 long multiply a 21fa ldiv 3 to 35 long divide a, o 23f6 lshl 2 long shift left a 23f5 lshr 2 long shift right a 21f9 norm 3 normalize a 26f4 slmul 4 signed long multiply a, o 26f5 sulmul 4 signed times unsigned long multiply a, o table 6.6 long arithmetic operation codes memory code mnemonic processor cycles name notes f0 rev 1 reverse 23fa xword 3 extend to word a 25f6 cword 2 to 3 check word a, e 21fd xdble 1 extend to double 24fc csngl 2 check single a, e 24f2 mint 1 minimum integer 25fa dup 1 duplicate top of stack 27f9 pop 1 pop processor stack 68fd reboot 2 reboot table 6.7 general operation codes
st20-gp1 39/116 a memory code mnemonic processor cycles name notes f2 bsub 1 byte subscript fa wsub 1 word subscript 28f1 wsubdb 1 form double word subscript 23f4 bcnt 1 byte count 23ff wcnt 1 word count f1 lb 1 load byte 23fb sb 2 store byte 24fa move move message i table 6.8 indexing/array operation codes memory code mnemonic processor cycles name notes 22f2 ldtimer 1 load timer 22fb tin timer input i 24fe talt 3 timer alt start 25f1 taltwt timer alt wait d, i 24f7 enbt 1 to 7 enable timer 22fe dist disable timer i table 6.9 timer handling operation codes
st20-gp1 40/116 a memory code mnemonic processor cycles name notes f7 in input message d fb out output message d ff outword output word d fe outbyte output byte d 24f3 alt 2 alt start 24f4 altwt 3 to 6 alt wait d 24f5 altend 8 alt end 24f9 enbs 1 to 2 enable skip 23f0 diss 1 disable skip 21f2 resetch 3 reset channel 24f8 enbc 1 to 4 enable channel 22ff disc 1 to 6 disable channel table 6.10 input and output operation codes memory code mnemonic processor cycles name notes 22f0 ret 2 return 21fb ldpi 1 load pointer to instruction 23fc gajw 2 to 3 general adjust workspace f6 gcall 6 general call 22f1 lend 4 to 5 loop end t table 6.11 control operation codes memory code mnemonic processor cycles name notes fd startp 5 to 6 start process f3 endp 4 to 6 end process d 23f9 runp 3 run process 21f5 stopp 2 stop process 21fe ldpri 1 load current priority table 6.12 scheduling operation codes
st20-gp1 41/116 a memory code mnemonic processor cycles name notes 21f3 csub0 2 check subscript from 0 a, e 24fd ccnt1 2 check count from 1 a, e 22f9 testerr 1 test error false and clear 21f0 seterr 1 set error 25f5 stoperr 1 to 3 stop on error (no error) d 25f7 clrhalterr 2 clear halt-on-error 25f8 sethalterr 1 set halt-on-error 25f9 testhalterr 1 test halt-on-error table 6.13 error handling operation codes memory code mnemonic processor cycles name notes 25fb move2dinit 1 initialize data for 2d block move 25fc move2dall 2d block copy i 25fd move2dnonzero 2d block copy non-zero bytes i 25fe move2dzero 2d block copy zero bytes i table 6.14 2d block move operation codes memory code mnemonic processor cycles name notes 27f4 crcword 34 calculate crc on word a 27f5 crcbyte 10 calculate crc on byte a 27f6 bitcnt 3 count bits set in word a 27f7 bitrevword 1 reverse bits in word 27f8 bitrevnbits 2 reverse bottom n bits in word a table 6.15 crc and bit operation codes
st20-gp1 42/116 a memory code mnemonic processor cycles name notes 27f3 c?err 2 check ?oating point error e 29fc fptesterr 1 load value true (fpu not present) 26f3 unpacksn 4 unpack single length ?oating point number a 26fd roundsn 7 round single length ?oating point number a 26fc postnormsn 7 to 8 post-normalize correction of single length ?oat- ing point number a 27f1 ldinf load single length in?nity table 6.16 floating point support operation codes memory code mnemonic processor cycles name notes 2cf7 cir 2 to 4 check in range a, e 2cfc ciru 2 to 4 check in range unsigned a, e 2bfa cb 2 to 3 check byte a, e 2bfb cbu 2 to 3 check byte unsigned a, e 2ffa cs 2 to 3 check sixteen a, e 2ffb csu 2 to 3 check sixteen unsigned a, e 2ff8 xsword 2 sign extend sixteen to word a 2bf8 xbword 3 sign extend byte to word a table 6.17 range checking and conversion instructions memory code mnemonic processor cycles name notes 2cf1 ssub 1 sixteen subscript 2cfa ls 1 load sixteen 2cf8 ss 2 store sixteen 2bf9 lbx 1 load byte and sign extend 2ff9 lsx 1 load sixteen and sign extend table 6.18 indexing/array instructions
st20-gp1 43/116 a memory code mnemonic processor cycles name notes 2ff0 devlb 3 device load byte a 2ff2 devls 3 device load sixteen a 2ff4 devlw 3 device load word a 62f4 devmove device move i 2ff1 devsb 3 device store byte a 2ff3 devss 3 device store sixteen a 2ff5 devsw 3 device store word a table 6.19 device access instructions memory code mnemonic processor cycles name notes 60f5 wait 4 to 10 wait d 60f4 signal 6 to 10 signal table 6.20 semaphore instructions memory code mnemonic processor cycles name notes 60f0 swapqueue 3 swap scheduler queue 60f1 swaptimer 5 swap timer queue 60f2 insertqueue 1 to 2 insert at front of scheduler queue 60f3 timeslice 3 to 4 timeslice 60fc ldshadow 6 to 23 load shadow registers a 60fd stshadow 5 to 17 store shadow registers a 62fe restart 19 restart 62ff causeerror 2 cause error 61ff iret 3 to 9 interrupt return 2bf0 settimeslice 1 set timeslicing status 2cf4 intdis 1 interrupt disable 2cf5 intenb 2 interrupt enable 2cfd gintdis 2 global interrupt disable 2cfe gintenb 2 global interrupt enable table 6.21 scheduling support instructions
st20-gp1 44/116 a memory code mnemonic processor cycles name notes 26fe ldtraph 11 load trap handler l 2cf6 ldtrapped 11 load trapped process status l 2cfb sttrapped 11 store trapped process status s 26ff sttraph 11 store trap handler s 60f7 trapenb 2 trap enable 60f6 trapdis 2 trap disable 60fb tret 9 trap return table 6.22 trap handler instructions memory code mnemonic processor cycles name notes 68fc ldprodid 1 load product identity 63f0 nop 1 no operation table 6.23 processor initialization and no operation instructions memory code mnemonic processor cycles name notes 64ff clockenb 2 clock enable 64fe clockdis 2 clock disable 64fd ldclock 1 load clock 64fc stclock 2 store clock table 6.24 clock instructions
st20-gp1 45/116 a 7 memory map the st20-gp1 processor memory has a 32-bit signed address range. words are addressed by 30-bit word addresses and a 2-bit byte-selector identi?es the bytes in the word. memory is divided into 4 banks which can each have different memory characteristics and can be used for different purposes. in addition, on-chip peripherals can be accessed via the device access instructions (see table 6.19). various memory locations at the bottom and top of memory are reserved for special system purposes. there is also a default allocation of memory banks to different uses. note that the st20-gp1 uses 30 bits of addressing internally, but addresses a20-a29 are not brought out to external pins. address bits a30 and a31 are used as bank selects. 7.1 system memory use the st20-gp1 has a signed address space where the address ranges from minint (#80000000) at the bottom to maxint (#7fffffff) at the top. the st20-gp1 has an area of 4 kbytes of ram at the bottom of the address space provided by on chip memory. the bottom of this area is used to store various items of system state. these addresses should not be accessed directly but via the appropriate instructions. near the bottom of the address space there is a special address memstart . memory above this address is for use by user programs while addresses below it are for private use by the processor and used for subsystem channels and trap handlers. the address of memstart can be obtained via the ldmemstartval instruction. 7.1.1 subsystem channels memory each dma channel between the processor and a subsystem is allocated a word of storage below memstart . this is used by the processor to store information about the state of the channel. this information should not normally be examined directly, although debugging kernels may need to do so. boot channel the subsystem channel which is a link input channel is identi?ed as a boot channel. when the processor is reset, and is set to boot from link, it waits for boot commands on this channel. 7.1.2 trap handlers memory the area of memory reserved for trap handlers is broken down hierarchically. full details on trap handlers is given in see section 4.6 on page 23. ? each high/low process priority has a set of trap handlers. ? each set of trap handlers has a handler for each of the four trap groups (refer to section 4.6.1). ? each trap group handler has a trap handler structure and a trapped process structure. ? each of the structures contains four words, as detailed in section 4.6.3. the contents of these addresses can be accessed via ldtraph , sttraph , ldtrapped and sttrapped instructions.
st20-gp1 46/116 a 7.2 boot rom when the processor boots from rom, it jumps to a boot program held in rom with an entry point 2 bytes from the top of memory at #7ffffffe. these 2 bytes are used to encode a negative jump of up to 256 bytes down in the rom program. for large rom programs it may then be necessary to encode a longer negative jump to reach the start of the routine. 7.3 internal peripheral space on-chip peripherals are mapped to addresses in the top half of memory bank 2 (address range #20000000 to #3fffffff). they can only be accessed by the device access instructions (see table 6.19). when used with addresses in this range, the device instructions access the on-chip peripherals rather than external memory. for all other addresses the device instructions access memory. standard load/store instructions to these addresses will access external memory. this area of memory is allocated to peripherals in 4k blocks, see the following memory map.
st20-gp1 47/116 a address use memory bank maxint #7fffffff bank 3 bootentry #7ffffffe boot entry point - user code/data/stack and boot rom #40000000 - reserved bank 2 #2000e000 - dsp controller peripheral (registers accessed via cpu device accesses) #2000c000 - parallel port controller peripheral (registers accessed via cpu device accesses) #2000a000 - pio controller peripheral (registers accessed via cpu device accesses) #20008000 - asc1 controller peripheral (registers accessed via cpu device accesses) #20006000 - asc0 controller peripheral (registers accessed via cpu device accesses) #20004000 - emi controller peripheral (registers accessed via cpu device accesses) #20002000 - interrupt and low power controller peripheral (registers accessed via cpu device accesses) #20000000 - external peripherals or memory #00000000 - user code/data/stack bank 1 #c0000000 - bank 0 start of external memory #80001000 - memstart #80000140 #80000130 low priority scheduler trapped process #80000120 low priority scheduler trap handler #80000110 low priority systemoperations trapped process #80000100 low priority systemoperations trap handler #800000f0 low priority error trapped process #800000e0 low priority error trap handler #800000d0 low priority breakpoint trapped process #800000c0 low priority breakpoint trap handler #800000b0 high priority scheduler trapped process #800000a0 high priority scheduler trap handler figure 7.1 st20-gp1 memory map
st20-gp1 48/116 a #80000090 high priority systemoperations trapped process bank 0 #80000080 high priority systemoperations trap handler #80000070 high priority error trapped process #80000060 high priority error trap handler #80000050 high priority breakpoint trapped process trapbase #80000040 high priority breakpoint trap handler #8000003c reserved - #8000001c #80000018 byte wide parallel port input dma channel #80000014 dsp module dma channel #80000010 link0 (boot) input channel #8000000c reserved #80000008 byte wide parallel port output dma channel #80000004 reserved minint #80000000 link0 output channel address use memory bank figure 7.1 st20-gp1 memory map
st20-gp1 49/116 a 8 memory subsystem the memory system consists of sram and a programmable memory interface. the speci?c details on the operation of the memory interface are described separately in chapter 9. 8.1 sram there is an internal memory module of 4 kbytes of sram. the internal sram is mapped into the base of the memory space from minint (#80000000) extending upwards, as shown in figure 8.1. this memory can be used to store on-chip data, stack or code for time critical routines. figure 8.1 sram mapping where internal memory overlays external memory, internal memory is accessed in preference. sram external memory minint #80000000 #80001000
st20-gp1 50/116 a 9 programmable memory interface the st20-gp1 programmable memory interface provides glueless support for up to four banks of sram or rom memory. suf?cient con?guration options are provided to enable the interface to be used with a wide variety of sram speeds, permitting systems to be built with optimum price/ performance trade-offs. although designed primarily for sram-like memory devices, the con?gurability enables glueless connection to other peripheral devices such as fifos and uarts. the programmable memory interface is also referred to as the external memory interface (emi). the emi provides con?guration information for four independent banks of external memory devices. the addresses of these bank boundaries are hard wired to give each bank one quarter of the address space of the machine. bank 0 occupies the lowest quarter of the [signed] address space, bank 3 is the highest, see figure 9.1. each bank can contain up to 1 mbyte of external memory. figure 9.1 memory allocation 00000000 7fffffff ffffffff 80000000 internal sram bfffffff c0000000 3fffffff 40000000 on-chip peripheral registers (including the emi con?guration registers) are mapped into the upper half of this bank. bank 0 addresses shown are physical addresses. on-chip peripheral subsystem channels traps/ exceptions internal sram 20000000 1fffffff bank 1 bank 2 bank 3 registers 80000000 memstart 80000fff
st20-gp1 51/116 a 9.1 emi signal descriptions the following section describes the functions of the emi pins. note that a signal name pre?xed by not indicates active low. memaddr1-19 external address bus. the st20-gp1 uses 30 bits of addressing internally but only the bottom 18 bits are brought out to external pins ( memaddr2-19 ); memaddr1 is generated by the emi. memaddr1-19 is valid and constant for the whole duration of an external access. the memory locations in each bank can be accessed at multiple addresses, as bits 20-29 are ignored when making external accesses. memdata0-15 external data bus. the data bus may be con?gured to be either 8 or 16 bits wide on a per bank basis. memdata0 is always the least signi?cant bit. memdata7 is the most signi?cant bit in 8-bit mode and memdata15 is the most signi?cant bit in 16-bit mode. when performing a write access to a bank con?gured to be 8-bits wide, memdata8-15 are held in a high-impedance state for the duration of the access; memdata0-7 behave according to the con?guration parameters as speci?ed in section 9.5. when making a write to a bank con?gured to be 16-bits wide, memdata0-15 behave according to the con?guration parameters. notmemce0-3 chip enable strobes, one per bank. the notmemce0-3 strobe corresponding to the bank being accessed will be active on both reads and writes to that bank. notmemoe3-0 output enable strobes, one per bank. the notmemoe0-3 strobe corresponding to the bank being accessed will be active only on reads to that bank. notmemwb0-1 byte selector strobes to select bytes within a 16-bit half-word. these strobes are shared between all four banks. notmemwb0 always corresponds to write data on memdata0-7 whether the bus is currently 8 or 16 bits wide. when the emi is writing to a bank con?gured to be 16 bits wide, notmemwb1 corresponds to memdata8-15 . when the emi is accessing a bank con?gured to be 8 bits wide, notmemwb1 becomes address bit 0 and follows the timing of memaddr1-19 for that bank. memwait halt external access. the emi samples memwait at or just after the midpoint of an access. if memwait is sampled high, the access is stalled. memwait will then continue to be sampled and the access proceeds when memwait is sampled low. the action of memwait may be disabled by software, see section 9.4. no mechanism is provided to abort an access; if memwait is held high too long the emi will become a contentious resource and may stall the st20-gp1. bootsource0-1 these signals are sampled immediately after reset and determine both the bootstrap behavior and
st20-gp1 52/116 a the initial bus width of all banks after reset. 9.2 strobe allocation 9.3 external accesses the emi differentiates accesses and transactions. an access is the lowest denominator of a transaction. since the st20 word size is 32 bits, several accesses are required to complete a transaction in most cases. the following are cases where several accesses may not be required: ? cpu executes a sb (store byte), lb (load byte) or ss (store sixteen), ls (load sixteen) instruc- tion. ? cpu is executing a move2dnonzero (2d block copy non-zero bytes) or move2dzero (2d block copy zero bytes) instruction and the data dictates that certain bytes are not to be written. ? the ?rst or last dma operation to or from a link is to a non word aligned byte address. figure 9.2 shows the generic emi activity during a read access and the con?gurable parameters. the rising edge of notmemoe always occurs at the end of the read access just after the data is latched on chip. notmemwb0 is always inactive during a read access. notmemwb1 activity during a read access depends on the bus width for the bank. the strobe is inactive if the bus width is con?gured to be 16-bit. if the bus width is con?gured to be 8-bit, notmemwb1 behaves as address bit 0 with the same timing as memaddr1-19 . bootsource[1:0] bootstrap start-up conditions 00 boot from link. 16-bit bus width for all banks. 01 boot from rom. 8-bit bus width for all banks. link operational. 10 boot from rom. 16-bit bus width for all banks. link powered down. 11 boot from rom. 8-bit bus width for all banks. link powered down. table 9.1 bootsource0-1 encoding pin bank allocation correspondence active access type notmemce0-3 1 per bank 0 t bank 0 1 t bank 1 2 t bank 2 3 t bank 3 reads and writes notmemoe0-3 1 per bank 0 t bank 0 1 t bank 1 2 t bank 2 3 t bank 3 reads only notmemwb0 shared amongst all banks. memdata0-7 writes only. indicates valid write data on memdata0-7 . notmemwb1 shared amongst all banks. 16-bit bus: memdata8-15 writes only. indicates valid write data on memdata8-15 . 8-bit bus: not applicable reads and writes. behaves as address bit 0 with same timing as memaddr1-19 . table 9.2 strobe allocation
st20-gp1 53/116 a figure 9.2 con?guration parameters for a read access memaddr1-19 notmemwb1 * notmemce notmemoe memdata0-7 memdata8-15 ? access duration cee1 time cee2 time oee1 time busrelease time read data latched on chip * only when bus width is 8-bit. inactive when bus width is 16-bit. ? ignored when bus width is 8-bit. ( memaddr0 )
st20-gp1 54/116 a figure 9.3 shows the generic emi activity during a write access. notmemoe is inactive during a write access, and the function of notmemwb1 is dictated by the bus width of the bank in the same way as for a read access. memdata8-15 is held in high impedance during a write access if the bus width is 8-bit, otherwise it follows the timing con?gured for memdata0-7 . figure 9.3 con?guration parameters for a write access the following caveats relate to strobe edge programming: ? if any of the strobe edges are programmed to occur outside the period de?ned by access- duration , the activity for that strobe is unde?ned. ? if a strobes rising and falling edges are programmed to occur on the same system clock edge, they will nullify each other and the strobe will stay in the same state. this rule also applies for consecutive accesses. transactions normally consist of several accesses which run consecutively without any dead cycles. the number of accesses in a transaction is dependent on the bus width and the nature of the memory bus request. table 9.3 lists the transaction composition and the behavior of memaddr1 and notmemwb0-1 for each access. memaddr1-19 notmemwb1 * notmemce notmemwb0 memdata0-7 memdata8-15 ? access duration cee1 time cee2 time wbe1 time * only when bus width is 8-bit. when bus width is 16-bit, notmemwb1 follows the timing wbe2 time speci?ed for notmemwb0 . ? held in high impedance when bus width is 8-bit. data drive delay ( memaddr0 )
st20-gp1 55/116 a key: l = low for whole access h = high for whole access a = active on write accesses i = inactive for whole access the emi buffers subsequent transactions which may occur, without intervening dead cycles except bus width valid bytes <3:0> number of accesses required memaddr1 notmemwb1 notmemwb0 123412341234 8 0001 1 l - - - l - - - a - - - 8 0010 1 l - - - h - - - a - - - 8 0011 2 l l - - l h - - a a - - 8 0100 1 h - - - l - - - a - - - 8 0101 2 l h - - l l - - a a - - 8 0110 2 l h - - h l - - a a - - 8 0111 3 l l h - l h l - a a a - 8 1000 1 h - - - h - - - a - - - 8 1001 2 l h - - l h - - a a - - 8 1010 2 l h - - h h - - a a - - 8 1011 3 l l h - l h h - a a a - 8 1100 2 h h - - l h - - a a - - 8 1101 3 l h h - l l h - a a a - 8 1110 3 l h h - h l h - a a a - 8 1111 4 l l h h l h l h a a a a 16 0001 1 l - - - i - - - a - - - 16 0010 1 l - - - a - - - i - - - 16 0011 1 l - - - a - - - a - - - 16 0100 1 h - - - i - - - a - - - 16 0101 2 l h - - i i - - a a - - 16 0110 2 l h - - a i - - i a - - 16 0111 2 l h - - a i - - a a - - 16 1000 1 h - - - a - - - i - - - 16 1001 2 l h - - i a - - a i - - 16 1010 2 l h - - a a - - i i - - 16 1011 2 l h - - a a - - a i - - 16 1100 1 h - - - a - - - a - - - 16 1101 2 l h - - i a - - a a - - 16 1110 2 l h - - a a - - i a - - 16 1111 2 l h - - a a - - a a - - table 9.3 transaction composition for valid bytes on internal memory bus
st20-gp1 56/116 a in the following two cases: ? the previous access was a read and the pending one is a write. the write access will not start until the programmed number of busreleasetime cycles have elapsed. ? the previous access was to a different bank to the pending access (bank switch). one cycle is always inserted between accesses to different banks. note that, if the ?rst condition is also true, further cycles may be inserted to account for busreleasetime . the ?rst case may be optimized slightly by making use of the datadrivedelay con?guration register parameter, see table 9.4. when this is used, the programmed busreleasetime may be smaller, reducing the number of dead cycles, see figure 9.4. figure 9.4 use of datadrivedelay parameter note, if datadrivedelay is used, it must be used for all banks. if this rule is not adhered to, bus contention may occur on bank switches. for example, consider case 2 in figure 9.4 above. if the busreleasetime coincides with the dead cycle inserted due to a bank switch, contention will occur unless datadrivedelay is programmed in the same way as if no bank switch had occurred. 9.4 memwait when enabled (see table 9.4), memwait is sampled at the midpoint of accesses which are con?gured to be four cycles or greater. if the duration of the external access is not an even number of cycles (i.e. the accessduration bit ?eld in the emiconfigdata register, see table 9.4, is an odd number), memwait is sampled on the internal rising clock edge just after the midpoint of the access. once a high has been sampled, the access is stalled. memwait suspends the state of the emi in the cycle after it is sampled high. the state remains suspended until memwait is sampled low. any strobe edges scheduled to occur in the cycle after memwait is sampled will not occur. strobe edges scheduled to occur on the same edge as memwait is sampled are not affected. figure 9.5 and figure 9.6 show the extension of the external memory cycle and the delaying of strobe read write busrelease time case 1. datadrivedelay set to zero. all dead time taken up by busreleasetime . read write busrelease time datadrivedelay case 2. datadrivedelay used to absorb some busreleasetime . dead time may be reduced. read data read data write data write data
st20-gp1 57/116 a transitions. note, the clock shown in the ?gures is the internal on-chip clock and is provided as a guide to show the minimum setup time of memwait relative to the strobes. figure 9.5 strobe activity without memwait figure 9.6 strobe activity with memwait clock memwait strobe1 strobe2 strobe3 clock memwait asserted wait cycle memwait strobe1 strobe2 strobe3
st20-gp1 58/116 a 9.5 emi con?guration registers con?guration parameters are stored in registers which are mapped into the device address space. they may be accessed using devsw (device store word) and devlw (device load word) instructions. the base addresses for the emi registers are given in the memory map chapter. emiconfigdata0-3 registers the emiconfigdata0-3 registers contain con?guration data for each of the emi banks. the format of each of the emiconfigdata0-3 registers is identical and is shown in table 9.4. emiconfiglock register the emiconfiglock register is provided to write protect the emiconfigdata0-3 registers (further writes to these registers are ignored). this bit is set by performing a devsw instruction to the given address; the write data is ignored. this register, once set, can only be cleared by resetting the st20-gp1. emiconfigstatus register the emiconfigstatus register is provided to indicate which registers have been written to and the emicon?gdata0-3 emi base address + #00, #04, #08, #0c read/write bit bit ?eld function units 0 memwaitenable enables the memwait pin. - 3:1 datadrivedelay drive delay of data bus for writes. phases 4 buswidth bus width of the bank (8 or 16 bits). buswidth bank width 0 16 bits 1 8 bits - 8:5 accessduration duration of the external access. cycles 10:9 busreleasetime duration bus release time. cycles 14:11 cee1time delay from access start to notmemce falling edge. phases 18:15 cee2time delay from notmemce rising edge to end of access. phases 22:19 oee1time delay from access start to notmemoe falling edge. phases 26:23 wbe1time delay from access start to notmemwb falling edge. phases 30:27 wbe2time delay from notmemwb rising edge to end of access. phases 31 reserved - table 9.4 emiconfigdata0-3 register format - 1 per bank emicon?glock emi base address + #10 write only bit bit ?eld function 0 configlock when set, the emiconfigdata0-3 registers are read only. table 9.5 emiconfiglock register format
st20-gp1 59/116 a status of the lock and stall bits. table 9.6 shows the format of the emiconfigstatus register. emiconfigstall register the emiconfigstall register can be used to stall the emi. when set it prevents the emi from accepting further requests from the cpu or communications subsystems. its main use is intended to be in systems which anticipate turning the power off; the emi must be inactive during such an event, otherwise battery backed memory may be corrupted. this register, once set, can only be cleared by resetting the st20-gp1. 9.6 reset and bootstrap behavior table 9.8 shows the state of the emi signals during reset. memaddr2-19 are driven with a copy of the value on the internal memory bus2-19. table 9.9 shows the con?guration values for all banks during and after reset. if the bootsource0-1 pins indicate that the st20-gp1 will boot from rom, the buswidth is set to the correct value as the st20-gp1 comes out of reset. emicon?gstatus emi base address + #20 read only bit bit field function 0 writtenbank0 bank 0 con?guration has been written to using a devsw instruction. 1 writtenbank1 bank 1 con?guration has been written to using a devsw instruction. 2 writtenbank2 bank 2 con?guration has been written to using a devsw instruction. 3 writtenbank3 bank 3 con?guration has been written to using a devsw instruction. 4 writelock emicon?gdata0-3 registers are write protected. 5 memstall emiconfigstall has been set. 31:6 reserved table 9.6 emiconfigstatus register format emicon?gstall emi base address + #30 write only bit bit ?eld function 0 emistall when set, this bit prevents the arbiter from granting any more accesses to the memory subsystem. table 9.7 emiconfigstall register format pins value memaddr2-19 valid memaddr1 high notmemce0-3 all high notmemoe0-1 all high notmemwb0-1 all high memdata0-15 high impedance table 9.8 emi signal values during reset
st20-gp1 60/116 a the behavior of the st20-gp1 after reset depends upon the value on the bootsource0-1 pins. in all cases, the emi is loaded with a slow default con?guration which is suitable for performing accesses to rom and sram (see figure 9.7). figure 9.7 default con?guration when booting from rom, the ?rst emi access will be an instruction fetch from bank 3. when booting from a link, the bootstrap is loaded into the st20-gp1 internal sram located logically at the bottom of bank 0. the default bus width for all banks is set at reset by reading the value on the bootsource0-1 pins (see table 9.1). if this bus width is inappropriate for a particular bank, then con?guration software must change it before it is accessed, otherwise some memory locations will contain indeterminate contents. note, particular care must be paid to instruction fetching behavior of the cpu. it is important to match the program memory with the correct bus width using bootsource0-1 . parameter bits value during and after reset units buswidth 1 depends on bootsource0-1 pins (see table 9.1, page 52). - memwaitenable 1 1 (enabled) - bankreadonly 1 0 (read/write) - accessduration 4 1010 (10 cycles) cycles cee1time 4 0000 phases cee2time 4 0000 phases oee1time 4 0000 phases wbe1time 4 1001 (9 phases; 4.5 cycles) phases wbe2time 4 0010 (2 phases; 1 cycle) phases busreleasetime 2 10 (2 cycles) cycles datadrivedelay 3 101 (5 phases; 2.5 cycles) phases table 9.9 con?guration register values during reset memdata0-15 (write) memaddr1-19 notmemce notmemoe notmemwb0-1 memdata0-15 (read) 10 cycles 5 phases 2 cycles 2 phases (1 cycle) 9 phases (4.5 cycles)
st20-gp1 61/116 a 10 clocks and low power controller 10.1 clocks an on-chip phase locked loop (pll) generates all the internal high frequency clocks. the pll is used to generate the internal clock frequencies needed for the cpu and the link. alternatively a direct clock input can provide the system clocks. the single clock input ( clockin ) must be 16.368 mhz for pll operation for gps. the internal clock may be turned off (including the pll) enabling power down mode. the st20-gp1 can be set to operate in timesonemode , which is when the pll is bypassed. during timesonemode the input clock must be in the range 0 to 30 mhz and should be nominally 50/50 mark space ratio. 10.1.1 speed select the speed of the internal processor clock is variable in discrete steps. the clock rate at which the st20-gp1 runs is determined by the logic levels applied on the two speed select lines speedselect0-1 as detailed in table 10.1. the frequency of clockin (fclk) for the speeds given in the table is 16.368 mhz. the sysratio register, see table 10.9, gives the speed at which the system pll is running. it contains the relevant pll multiply ratio when using the pll, or contains the value 1 when in timesonemode for the pll. table 10.1 processor speed selection 10.2 low power control the st20-gp1 is designed for 0.5 micron, 3.3v cmos technology and runs at speeds of up to 32.736 mhz. 3.3v operation provides reduced power consumption internally and allows the use of low power peripherals. in addition, to further enhance the potential for battery operation, a low power power-down mode is available. the different power levels of the st20-gp1 are listed below. ? operating power power consumed during functional operation. ? stand-by power power consumed during little or no activity. the cpu is idle but ready to immediately respond to an interrupt/reschedule. ? power-down internal clocks are stopped and power consumption is signi?cantly reduced. functional operation is stalled. normal functional operation can be resumed from previous speedselect1 speedselect0 processor clock speed (mhz) processor cycle time (ns) approximate phase lock loop factor (pllx) link speed (mbits/s) 0 0 timesonemode 0.4 x fclk 0 1 16.368 61.0 1 19.641 1 0 32.736 30.5 2 19.641 1 1 reserved
st20-gp1 62/116 a state as soon as the clocks are stable. all internal logic is static so no information is lost during power down. ? power to most of the chip removed only the real time clock supply ( rtcvdd ) power on. 10.2.1 power-down mode the st20-gp1 enters power-down when: ? the low power alarm is programmed and started, via con?guration registers, providing there are no interrupts pending. the st20-gp1 exits power-down when: ? an unmasked interrupt becomes pending. ? the low power alarm counter reaches zero. in power-down mode the processor and all peripherals are stopped, including the external memory controller and optionally the pll. effectively the internal clock is stopped and functional operation is stalled. on restart the clock is restarted and the chip resumes normal functional operation. 10.2.2 low power mode low power mode can be achieved in one of two ways, as listed below. ? availability of direct clock input this allows external control of clocking directly and thus direct control of power consumption. ? internal global system clock may be stopped in this case the external clock remains run- ning. this mechanism allows the pll to be kept running (if desired) so that wake up from low power mode will be fast. wake-up from low power mode can be from: speci?c external pin activity ( interrupt pin); or the low power timer alarm. the low power timer and alarm are provided to control the duration for which the global clock generation is stopped during low power mode. the timer and alarm registers can be set by the device store instructions and read by the device load instructions. low power timer the timer keeps track of real time, even when the internal clocks are stopped. the timer is a 64-bit counter which runs off an external clock ( lpclockin ). this clock rate must not be more than one eighth of the system clock rate. the real time clock is powered from a separate vdd ( rtcvdd ) allowing it to be maintained at minimal power consumption. low power alarm there is also a 40-bit counter which can be used as a low power alarm or as a watchdog timer, this is determined by the setting of the wdenable register, see table 10.10. alarm a write to the lpalarmstart register starts the low power alarm counter and the st20-gp1 enters low power mode. when the counter has counted down to zero, assuming no other valid wake-up sources occur ?rst, the st20-gp1 exits low power mode and the global clocks are turned back on. whilst the clocks are turned off the lowpowerstatus pin is high, otherwise it is low.
st20-gp1 63/116 a watchdog timer the low power alarm counter is set to operate as a watchdog timer by setting the wdenable register to 1. this disables entering low power mode when starting the timer. the low power alarm is programmed and started as normal. the wdflag register can be read to determine if the device was reset by the notrst input or by a watchdog time-out. when the low power alarm counts down to the value #1, the notwdreset pin is asserted low for 1 low power clock cycle. in addition an internal reset of the st20-gp1 is performed. 10.3 low power con?guration registers the low power controller is allocated a 4k block of memory in the internal peripheral address space. information on low power mode is stored in registers as detailed in the following section. the registers can be examined and set by the devlw (device load word) and devsw (device store word) instructions, see table 6.19 on page 43. note, they can not be accessed using memory instructions. lptimerls and lptimerms the lptimerls and lptimerms registers are the least signi?cant word and most signi?cant word of the lptimer register. this enables the least signi?cant or most signi?cant word to be written independently without affecting the other word. table 10.2 lptimerls register format table 10.3 lptimerms register format when the lptimer register is written, the low power timer is stopped and the new value is available to be written to the low power timer. lptimerstart a write to the lptimerstart register starts the low power timer counter. the counter is stopped and the lptimerstart register reset if either counter word ( lptimerls and lptimerms ) is written. note, setting the lptimerstart register to zero does not stop the timer. table 10.4 lptimerstart register format lptimerls lpc base address + #400 read/write bit bit ?eld function 31:0 lptimerls least signi?cant word of the low power timer. lptimerms lpc base address + #404 read/write bit bit ?eld function 31:0 lptimerms most signi?cant word of the low power timer. lptimerstart lpc base address + #408 write bit bit ?eld function 0 lptimerstart a write to this bit starts the low power timer counter.
st20-gp1 64/116 a lpalarmls and lpalarmms the lpalarmls and lpalarmms registers are the least signi?cant word and most signi?cant word of the lpalarm register. this is used to program the low power alarm. table 10.5 lpalarmls register format table 10.6 lpalarmms register format lpalarmstart a write to the lpalarmstart register starts the low power alarm counter. the counter is stopped and the lpstart register reset if either counter word ( lptimerls and lptimerms ) is written. table 10.7 lpalarmstart register format lpsyspll the lpsyspll register controls the system clock pll operation when low power mode is entered. this allows a compromise between wake-up time and power consumption during stand-by. table 10.8 lpsyspll register format lpalarmls lpc base address + #410 read/write bit bit ?eld function 31:0 lpalarmls least signi?cant word of the low power alarm. lpalarmms lpc base address + #414 read/write bit bit ?eld function 7:0 lpalarmms most signi?cant word of the low power alarm. lpalarmstart lpc base address + #418 write bit bit ?eld function 0 lpalarmstart a write to this bit starts the low power alarm counter. lpsyspll lpc base address + #420 read/write bit bit ?eld function 1:0 lpsyspll determines the system clock pll when low power mode is entered, as follows: lpsyspll1:0 system clock 00 pll off 01 pll reference on and power on 10 pll reference on and power on 11 pll on
st20-gp1 65/116 a sysratio the sysratio register is a read only register and gives the speed at which the system pll is running. it contains the relevant pll multiply ratio when using the pll, or contains the value 1 when in timesonemode for the pll. table 10.9 sysratio register format wdenable setting the wdenable register enables the low power alarm counter to be used as a watchdog timer. table 10.10 wdenable register format wdflag this register can be used to determine if the device was reset by the notrst input or by a watchdog time-out. note that this bit is not reset by the cpureset input. table 10.11 wdflag register format 10.4 clocking sources the low power timer and alarm must be clocked at all times by one of the following clocking sources: ? external clock input ( lpclockin ) this clock must not be more than one eighth of the sys- tem clock rate. in this case the lpclockosc pin should not be connected on the board. ? watch crystal, as in figure 10.1. sysratio lpc base address + #500 read bit bit ?eld function 5:0 sysratio pll speed, as follows: sysratio pll 1 x1 timesonemode 2 x1 16.368 mhz 4 x2 32.736 mhz 6 x3 reserved wdenable lpc base address + #510 read/write bit bit ?eld function 0 wdenable determines whether the low power alarm is set to operate as an alarm or as a watchdog timer. 0 alarm 1 watchdog wdflag lpc base address + #514 read bit bit ?eld function 0 wdflag watchdog timer ?ag. 0 set to 0 by an external notrst 1 set to 1 when the watchdog counter is #1 and the wdenable register is 1
st20-gp1 66/116 a figure 10.1 watch crystal clocking source internal low power clock watch crystal lpclockosc lpclockin (32768 hz) gnd gnd 22 pf 10 pf a b a - this node should have very low capacitance < 10 pf. b - this node must have zero dc load. 330 k w
st20-gp1 67/116 a 11 system services the system services module includes the control system, the pll and power control. system services include all the necessary logic to initialize and sustain operation of the device and also includes error handling and analysis facilities. 11.1 reset, initialization and debug the st20-gp1 is controlled by a notrst pin which is a global power-on-reset. the cpu itself can also be controlled by cpureset and cpuanalyse signals separately from the on-chip peripherals. 11.1.1 reset notrst initializes the device and causes it to enter its boot sequence which can either be in off- chip rom or can be received down a link (see section 11.2 on bootstrap). notrst must be asserted at power-on. when notrst is asserted low, all modules are forced into their power-on reset condition. the clocks are stopped. the rising edge of notrst is internally synchronized and delayed until the clocks are stable before starting the initialization sequence. cpureset is provided as a functional reset which is quicker to reboot as the pll is not reset. in other respects the effect is the same as notrst . cpureset can be used in conjunction with cpuanalyse . 11.1.2 cpuanalyse if cpuanalyse is taken high when the st20-gp1 is running, the st20-gp1 will halt at the next descheduling point. cpureset may then be asserted. when cpureset comes low again the st20-gp1 will be in its reset state, and information on the state of the machine when it was halted by the assertion of cpuanalyse , is maintained permitting analysis of the halted machine. an input link will continue with outstanding transfers. an output link will not make another access to memory for data but will transmit only those bytes already in the link buffer. providing there is no delay in link acknowledgment, the link will be inactive within a few microseconds of the st20-gp1 halting. if cpuanalyse is taken low without cpureset going high the processor state and operation are unde?ned. 11.1.3 errors software errors, such as arithmetic over?ow or array bounds violation, can cause an error ?ag to be set. this ?ag is directly connected to the errorout pin. the st20-gp1 can be set to ignore the error ?ag in order to optimize the performance of a proven program. if error checks are removed any unexpected error then occurring will have an arbitrary unde?ned effect . the st20-gp1 can alternatively be set to halt-on-error to prevent further corruption and allow postmortem debugging. the st20-gp1 also supports user de?ned trap handlers, see section 4.6 on page 23 for details. if a high priority process pre-empts a low priority one, status of the error and haltonerror ?ags is saved for the duration of the high priority process and restored at the conclusion of it. status of both ?ags is transmitted to the high priority process. either ?ag can be altered in the process without
st20-gp1 68/116 a upsetting the error status of any complex operation being carried out by the pre-empted low priority process. in the event of a processor halting because of haltonerror , the link will ?nish outstanding transfers before shutting down. if cpuanalyse is asserted then all inputs continue but outputs will not make another access to memory for data. memory refresh will continue to take place. 11.2 bootstrap the st20-gp1 can be bootstrapped from external rom, internal rom or from a link. this is determined by the setting of the bootsource0-1 pins, see table 9.1 on page 52. if both bootsource0-1 pins are held low it will boot from a link. if either or both pins are held high, it will boot from rom. this is sampled once only by the st20-gp1, before the ?rst instruction is executed after reset. 11.2.1 booting from rom when booting from rom, the st20-gp1 starts to execute code from the top two bytes in external memory, at address #7ffffffe which should contain a backward jump to a program in rom. 11.2.2 booting from link when booting from a link, the st20-gp1 will wait for the ?rst bootstrap message to arrive on the link. the ?rst byte received down the link is the control byte. if the control byte is greater than 1 (i.e. 2 to 255), it is taken as the length in bytes of the boot code to be loaded down the link. the bytes following the control byte are then placed in internal memory starting at location memstart . following reception of the last byte the st20-gp1 will start executing code at memstart . the memory space immediately above the loaded code is used as work space. a byte arriving on the bootstrapping link after the last bootstrap byte, is retained and no acknowledge is sent until a process inputs from the link. 11.2.3 peek and poke any location in internal or external memory can be interrogated and altered when the st20-gp1 is waiting for a bootstrap from link. when booting from link, if the ?rst byte (the control byte) received down the link is greater than 1, it is taken as the length in bytes of the boot code to be loaded down the link. if the control byte is 0 then eight more bytes are expected on the link. the ?rst four byte word is taken as an internal or external memory address at which to poke (write) the second four byte word. if the control byte is 1 the next four bytes are used as the address from which to peek (read) a word of data; the word is sent down the output channel of the link.
st20-gp1 69/116 a figure 11.1 peek, poke and bootstrap note, peeks and pokes in the address range #20000000 to #3fffffff access the internal peripheral device registers. therefore they can be used to con?gure the emi before booting. note that addresses that overlap the internal peripheral addresses (#20000000 to 3fffffff) can not be accessed via the link. following a peek or poke , the st20-gp1 returns to its previously held state. any number of accesses may be made in this way until the control byte is greater than 1, when the st20-gp1 will commence reading its bootstrap program. 0 address data 1 address data n bootstrap 1n poke peek reply bootstrap control byte where n is 2 to 255
st20-gp1 70/116 a 12 serial link interface (os-link) the os-link based serial communications subsystem provides serial data transfer. its main function is for booting the device during software development. the os-link is a serial communications engine consisting of two signal wires, one in each direction. os-links use an asynchronous bit-serial (byte-stream) protocol, each bit received is sampled ?ve times, hence the term over-sampled links (os-links). the os-link provides a pair of channels, one input and one output channel. the os-link is used for the following purposes: ? bootstrapping the program which is executed at power up or after reset can reside in rom in the address space, or can be loaded via the os-link directly into memory. ? diagnostics diagnostic and debug software can be downloaded over the link connected to a pc or other diagnostic equipment, and the system performance and functionality can be monitored. ? communicating with os-link peripherals or other st20 devices. 12.1 os-link protocol the quiescent state of a link output is low. each data byte is transmitted as a high start bit followed by a one bit followed by eight data bits followed by a low stop bit (see figure 12.1). the least signi?cant bit of data is transmitted ?rst. after transmitting a data byte the sender waits for the acknowledge, which consists of a high start bit followed by a zero bit. the acknowledge signi?es both that a process was able to receive the acknowledged data byte and that the receiving link is able to receive another byte. the sending link reschedules the sending process only after the acknowledge for the ?nal byte of the message has been received. the link allows an acknowledge to be sent before the data has been fully received. figure 12.1 os-link data and acknowledge formats 12.2 os-link speed the os-link data rate is 19.6416 mbits/s. this rate is the result of basing the clock on the gps-speci?c 16.368 mhz input. standard 20 mhz development systems are not within speci?cation, but operate correctly under benign conditions. to operate within spec, the reference clock for 5 mhz (b008, c011, c012) systems should be changed to 4.9104 mhz, for 10 mhz to 9.8208 mhz. 012 34567 data ack hh l l h
st20-gp1 71/116 a 12.3 os-link connections links are ttl compatible and intended to be used in electrically quiet environments, between devices on a single printed circuit board or between two boards via a backplane. direct connection may be made between devices separated by a distance of less than 300 mm. for longer distances a matched 100 ohm transmission line should be used with series matching resistors (rm), see figure 12.3. when this is done the line delay should be less than 0.4 bit time to ensure that the re?ection returns before the next data bit is sent. buffers may be used for very long transmissions, see figure 12.4. if so, their overall propagation delay should be stable within the skew tolerance of the link, although the absolute value of the delay is immaterial. figure 12.2 os-links directly connected figure 12.3 os-links connected by transmission line figure 12.4 os-links connected by buffers oslinkout oslinkin oslinkin oslinkout oslinkout oslinkin oslinkin oslinkout rm rm zo=100 ohms zo=100 ohms oslinkout oslinkin oslinkin oslinkout buffers
st20-gp1 72/116 a 13 uart interface (asc) the uart interface, also referred to as the asynchronous serial controller (asc), provides serial communication between the st20 device and other microcontrollers, microprocessors or external peripherals. the asc supports full-duplex asynchronous communication, where both the transmitter and the receiver use the same data frame format and the same baud rate. data is transmitted on the transmit data output pin ( txd ) and received on the receive data input pin ( rxd ). figure 13.1 block diagram of the asc cpu clock transmit buffer register ( txbuffer ) receive buffer register ( rxbuffer ) internal bus transmit shift register receive shift register txd mux 0 1 sampling rxd transmitter empty interrupt error interrupt receive buffer full interrupt serial port control shift clock clock loopback mode stopbits baud rate timer run reload register rxenable parityodd 4 -input or gate asc_interrupt transmit buffer empty interrupt
st20-gp1 73/116 a eight or nine bit data transfer, parity generation, and the number of stop bits are programmable. parity, framing, and overrun error detection is provided to increase the reliability of data transfers. transmission and reception of data is double-buffered. for multiprocessor communication, a mechanism to distinguish address from data bytes is included. testing is supported by a loop-back option. a 16-bit baud rate generator provides the asc with a separate serial clock signal. 13.1 asynchronous serial controller operation the operating mode of the serial channel asc is controlled by the control register ( asccontrol ). this register contains control bits for mode and error check selection, and status flags for error identification. a transmission is started by writing to the transmit buffer register ( asctxbuffer ), see table 13.3. data transmission is double-buffered, therefore a new character may be written to the transmit buffer register, before the transmission of the previous character is complete. this allows characters to be sent back-to-back without gaps. data reception is enabled by the receiver enable bit ( rxenable ) in the asccontrol register. after reception of a character has been completed the received data, and received parity bit if selected, can be read from the receive buffer register ( ascrxbuffer ), refer to table 13.4. data reception is double-buffered, so the reception of a second character may begin before the previously received character has been read out of the receive buffer register. the overrun error status flag ( overrunerror ) in the status register ( ascstatus ), see table 13.7, will be set when the receive buffer register has not been read by the time reception of a second character is complete. the previously received character in the receive buffer is overwritten, and the ascstatus register is updated to reflect the reception of the new character. the loop-back option (selected by the loopback bit) internally connects the output of the transmitter shift register to the input of the receiver shift register. this may be used to test serial communication routines at an early stage without having to provide an external network. 13.1.1 data frames data frames are selected by the setting of the mode bit field in the asccontrol register, see table 13.5. 8-bit data frames 8-bit data frames consist of: ? eight data bits d0-7 ; ? seven data bits d0-6 plus an automatically generated parity bit. parity may be odd or even, depending on the parityodd bit in the asccontrol register. an even parity bit will be set, if the modulo-2-sum of the seven data bits is 1. an odd parity bit will be cleared in this case. the parity error flag ( parityerror ) will be set if a wrong parity bit is received. the parity bit itself will be stored in bit 7 of the ascrxbuffer register.
st20-gp1 74/116 a figure 13.2 8-bit data frames 9-bit data frames 9-bit data frames consist of: ? nine data bits d0-8 ; ? eight data bits d0-7 plus an automatically generated parity bit; ? eight data bits d0-7 plus a wake-up bit. parity may be odd or even, depending on the parityodd bit in the asccontrol register. an even parity bit will be set, if the modulo-2-sum of the eight data bits is 1. an odd parity bit will be cleared in this case. the parity error flag ( parityerror ) will be set if a wrong parity bit is received. the parity bit itself will be stored in bit 8 of the ascrxbuffer register, see table 13.4. in wake-up mode, received frames are only transferred to the receive buffer register if the ninth bit (the wake-up bit) is 1. if this bit is 0, no receive interrupt request will be activated and no data will be transferred. this feature can be used to control communication in multi-processor systems. when the master processor wants to transmit a block of data to one of several slaves, it first sends out an address byte which identifies the target slave. an address byte differs from a data byte in that the additional ninth bit is a 1 for an address byte and a 0 for a data byte, so no slave will be interrupted by a data byte. an address byte will interrupt all slaves (operating in 8-bit data + wake- up bit mode), so each slave can examine the 8 least significant bits (lsbs) of the received character (the address). the addressed slave will switch to 9-bit data mode, which enables it to receive the data bytes that will be coming (with the wake-up bit cleared). the slaves that are not being addressed remain in 8-bit data + wake-up bit mode, ignoring the following data bytes. 2nd stop bit 1st stop bit start bit d0 (lsb) d1 d2 d3 d4 d5 d6 8th bit data bit ( d7 ) parity bit
st20-gp1 75/116 a figure 13.3 9-bit data frames transmission transmission begins at the next overflow of the divide-by-16 counter (see figure 13.3 above), provided that the run bit is set and data has been loaded into the asctxbuffer . the transmitted data frame consists of three basic elements: ? the start bit ? the data ?eld (8 or 9 bits, least signi?cant bit (lsb) ?rst, including a parity bit, if selected) ? the stop bits (0.5, 1, 1.5 or 2 stop bits) data transmission is double buffered. when the transmitter is idle, the transmit data written into the transmit buffer is immediately moved to the transmit shift register, thus freeing the transmit buffer for the next data to be sent. this is indicated by the transmit buffer empty flag ( txbufempty ) being set. the transmit buffer can be loaded with the next data, while transmission of the previous data is still going on. the transmitter empty flag ( txempty ) will be set at the beginning of the last data frame bit that is transmitted, i.e. during the first system clock cycle of the first stop bit shifted out of the transmit shift register. reception reception is initiated by a falling edge on the data input pin ( rxd ), provided that the run and rxenable bits are set. the rxd pin is sampled at 16 times the rate of the selected baud rate. a majority decision of the first, second and third samples of the start bit determines the effective bit value. this avoids erroneous results that may be caused by noise. if the detected value is not a 0 when the start bit is sampled, the receive circuit is reset and waits for the next falling edge transition of the rxd pin. if the start bit is valid, the receive circuit continues sampling and shifts the incoming data frame into the receive shift register. for subsequent data and parity bits, the majority decision of the seventh, eighth and ninth samples in each bit time is used to determine the effective bit value. for 0.5 stop bits, the majority decision of the third, fourth, and fifth samples during the stop bit is used to determine the effective stop bit value. for 1 and 2 stop bits, the majority decision of the seventh, eighth, and ninth samples during the stop bits is used to determine the effective stop bit values. 1st stop bit 2nd stop bit start bit d0 (lsb) d1 d2 d3 d4 d5 d6 9th bit d7 data bit ( d8 ) parity bit wake-up bit
st20-gp1 76/116 a for 1.5 stop bits, the majority decision of the fifteenth, sixteenth, and seventeenth samples during the stop bits is used to determine the effective stop bit value. when the last stop bit has been received (at the end of the last programmed stop bit period) the content of the receive shift register is transferred to the receive data buffer register ( ascrxbuffer ). the receive buffer full flag ( rxbuffull ) is set, and the parity ( parityerror ) and framing error ( frameerror ) flags are updated, after the last stop bit has been received (at the end of the last stop bit programmed period), regardless of whether valid stop bits have been received or not. the receive circuit then waits for the next start bit (falling edge transition) at the rxd pin. reception is stopped by clearing the rxenable bit. a currently received frame is completed including the generation of the receive status flags. start bits that follow this frame will not be recognized. note : in wake-up mode, received frames are only transferred to the receive buffer register if the ninth bit (the wake-up bit) is 1. if this bit is 0, the receive buffer full ( rxbuffull ) ?ag will not be set and no data will be transferred. 13.2 hardware error detection capabilities to improve the safety of serial data exchange, the asc provides three error status flags in the ascstatus register which indicate if an error has been detected during reception of the last data frame and associated stop bits. the parity error ( parityerror ) bit is set when the parity check on the received data is incorrect. the framing error ( frameerror ) bit is set when the rxd pin is not a 1 during the programmed number of stop bit times, sampled as described in the section above. the overrun error ( overrunerror ) bit is set when the last character received in the ascrxbuffer register has not been read out before reception of a new frame is complete. these flags are updated simultaneously with the transfer of data to the receive buffer. 13.3 baud rate generation the asc has its own dedicated 16-bit baud rate generator with 16-bit reload capability. the baud rate generator is clocked with the cpu clock. the timer counts downwards and can be started or stopped by the run bit in the asccontrol register. each underflow of the timer provides one clock pulse. the timer is reloaded with the value stored in its 16-bit reload register each time it underflows. the ascbaudrate register is the dual-function baud rate generator/reload register. a read from this register returns the content of the timer, writing to it updates the reload register. an auto-reload of the timer with the content of the reload register is performed each time the ascbaudrate register is written to. however, if the run bit is 0 at the time the write operation to the ascbaudrate register is performed, the timer will not be reloaded until the first cpu clock cycle after the run bit is 1.
st20-gp1 77/116 a 13.3.1 baud rates the baud rate generator provides a clock at 16 times the baud rate. the baud rate and the required reload value for a given baud rate can be determined by the following formulas: where: represents the content of the ascbaudrate register, taken as unsigned 16-bit integer, f cpu is the frequency of the cpu. note that altering the cpu speed selection pins will thus change the baud rate. software can accommodate this by reading the sysratio register, see section 10.3, in calculating the cpu frequency. the table below lists various commonly used baud rates together with the required reload values and the deviation errors for the st20-gp1 using a cpu clock of 33.736 mhz. note: the deviation errors given in the table above are rounded. 13.4 interrupt control the asc contains two registers that are used to control interrupts, the status register ( ascstatus ) and the interrupt enable register ( ascintenable ). the status bits in the ascstatus register determine the cause of the interrupt. interrupts will occur when a status bit is 1 (high) and the corresponding bit in the ascintenable register is 1. the error interrupt signal ( errorinterrupt ) is generated by the asc from the or of the parity error, framing error, and overrun error status bits after they have been anded with the corresponding enable bits in the ascintenable register. baud rate reload value (exact) reload value (integer) reload value (hex) deviation error 38400 53.28125 53 35 -0.53% 28800 71.04167 71 47 -0.06% 19200 106.5625 107 6b 0.41% 14400 142.0833 142 8e -0.06% 9600 213.125 213 d5 -0.06% 4800 426.25 426 1aa -0.06% 2400 852.5 853 355 0.06% 1200 1705 1705 6a9 0.00% 600 3410 3410 d52 0.00% 300 6820 6820 1aa4 0.00% 75 27280 27280 6a90 0.00% table 13.1 baud rates baud rate = 16 () = ( 16 x baud rate ) f cpu f cpu
st20-gp1 78/116 a an overall interrupt request signal ( asc_interrupt ) is generated from the or of the errorinterrupt signal and the txempty , txbufempty and rxbuffull signals. note : the status register cannot be written directly by software. the reset mechanism for the status register is described below. the transmitter interrupt status bits ( txempty , txbufempty ) are reset when a character is written to the transmitter buffer. the receiver interrupt status bit ( rxbuffull ) is reset when a character is read from the receive buffer. the error status bits ( parityerror , frameerror , overrunerror ) are reset when a character is read from the receive buffer. figure 13.4 asc status and interrupt registers & & & & & & register register rxbuffullie txemptyie txbufemptyie parityerrorie frameerrorie overrunerrorie ascintenable ascstatus or receive buffer full interrupt transmitter empty interrupt transmit buffer empty interrupt error interrupt rxbuffull txempty txbufempty parityerror frameerror overrunerror reserved reserved read 0, write 0 read 0, write 0
st20-gp1 79/116 a 13.4.1 using the asc interrupts for normal operation (i.e. besides the error interrupt) the asc provides three interrupt requests to control data exchange via the serial channel: ? txbufempty is activated when data is moved from asctxbuffer to the transmit shift reg- ister. ? txempty is activated before the last bit of a frame is transmitted. ? rxbuffull is activated when the received frame is moved to ascrxbuffer . the transmitter generates two interrupts. this provides advantages for the servicing software. for single transfers it is sufficient to use the transmitter interrupt ( txempty ), which indicates that the previously loaded data has been transmitted, except for the last bit of a frame. for multiple back-to-back transfers it is necessary to load the next data before the last bit of the previous frame has been transmitted. this leaves just one bit-time for the handler to respond to the transmitter interrupt request. using the transmit buffer interrupt ( txbufempty ) to reload transmit data allows the time to transmit a complete frame for the service routine, as asctxbuffer may be reloaded while the previous data is still being transmitted. as shown in figure 13.5 below, txbufempty is an early trigger for the reload routine, while txempty indicates the completed transmission of the data field of the frame. therefore, software using handshake should rely on txempty at the end of a data block to make sure that all data has really been transmitted. figure 13.5 asc interrupt generation 13.5 asc con?guration registers ascbaudrate register the ascbaudrate register is the dual-function baud rate generator/reload register. a read from this register returns the content of the timer, writing to it updates the reload register. an auto-reload of the timer with the content of the reload register is performed each time the ascbaudrate register is written to. however, if the run bit of the asccontrol register, see table 13.5, is 0 at the time the write operation to the ascbaudrate register is performed, the timer will not be reloaded until the first cpu clock cycle after the run bit is 1. idle idle start start start stop stop stop txbufempty txempty txbufempty txbufempty txempty txempty rxbuffull rxbuffull rxbuffull
st20-gp1 80/116 a asctxbuffer register writing to the transmit buffer register starts data transmission. ascrxbuffer register the received data and, if provided by the selected operating mode, the received parity bit can be read from the receive buffer register. ascbaudrate asc base address + #00 read/write bit bit ?eld write function read function 15:0 reloadval 16-bit reload value 16-bit count value table 13.2 ascbaudrate register format asctxbuffer asc base address + #04 write only bit bit ?eld function 0 td0 transmit buffer data d0 1 td1 transmit buffer data d1 2 td2 transmit buffer data d2 3 td3 transmit buffer data d3 4 td4 transmit buffer data d4 5 td5 transmit buffer data d5 6 td6 transmit buffer data d6 7 td7/parity transmit buffer data d7 , or parity bit - dependent on the operating mode (the setting of the mode ?eld in the asccontrol register). 8 td8/parity /wake/0 transmit buffer data d8 , or parity bit, or wake-up bit or unde?ned - dependent on the operating mode (the setting of the mode ?eld in the asccontrol register). note: if the mode ?eld selects an 8-bit frame then this bit should be written as 0. 15:9 reserved. write 0. table 13.3 asctxbuffer register format
st20-gp1 81/116 a asccontrol register this register controls the operating mode of the asc and contains control bits for mode and error check selection, and status flags for error identification. note : programming the mode control field ( mode ) to one of the reserved combinations may result in unpredictable behavior. note : serial data transmission or reception is only possible when the baud rate generator run bit ( run ) is set to 1. when the run bit is set to 0, txd will be 1. setting the run bit to 0 will immediately freeze the state of the transmitter and receiver. this should only be done when the asc is idle. ascrxbuffer asc base address + #08 read only bit bit ?eld function 0 rd0 receive buffer data d0 1 rd1 receive buffer data d1 2 rd2 receive buffer data d2 3 rd3 receive buffer data d3 4 rd4 receive buffer data d4 5 rd5 receive buffer data d5 6 rd6 receive buffer data d6 7 rd7/parity receive buffer data d7 , or parity bit - dependent on the operating mode (the setting of the mode bit in the asccontrol register). note: if the mode ?eld selects a 7-bit frame then this bit is unde?ned. software should ignore this bit when reading 7-bit frames. 8 rd8/parity/ wake/x receive buffer data d8 , or parity bit, or wake-up bit - dependent on the operating mode (the setting of the mode ?eld in the asccontrol register). note: if the mode ?eld selects a 7- or 8-bit frame then this bit is unde?ned. software should ignore this bit when reading 7- or 8-bit frames. 15:9 reserved. will read back 0. table 13.4 ascrxbuffer register format
st20-gp1 82/116 a ascintenable register the ascintenable register enables a source of interrupt. interrupts will occur when a status bit in the ascstatus register is 1, and the corresponding bit in the ascintenable register is 1. asccontrol asc base address + #0c read/write bit bit ?eld function 2:0 mode asc mode control mode2:0 mode 000 reserved 001 8-bit data 010 reserved 011 7-bit data + parity 100 9-bit data 101 8-bit data + wake up bit 110 reserved 111 8-bit data + parity 4:3 stopbits number of stop bits selection stopbits1:0 number of stop bits 00 0.5 stop bits 01 1 stop bit 10 1.5 stop bits 11 2 stop bits 5 parityodd parity selection 0 even parity (parity bit set on odd number of 1s in data) 1 odd parity (parity bit set on even number of 1s in data) 6 loopback loopback mode enable bit 0 standard transmit/receive mode 1 loopback mode enabled 7 run baud rate generator run bit 0 baud rate generator disabled (asc inactive) 1 baud rate generator enabled 8 rxenable receiver enable bit 0 receiver disabled 1 receiver enabled 15:9 reserved. write 0, will read back 0. table 13.5 asccontrol register format
st20-gp1 83/116 a ascintenable asc base address + #10 read/write bit bit ?eld function 0 rxbuffullie receiver buffer full interrupt enable 0 receiver buffer full interrupt disable 1 receiver buffer full interrupt enable 1 txemptyie transmitter empty interrupt enable 0 transmitter empty interrupt disable 1 transmitter empty interrupt enable 2 txbufemptyie transmitter buffer empty interrupt enable 0 transmitter buffer empty interrupt disable 1 transmitter buffer empty interrupt enable 3 parityerrorie parity error interrupt enable 0 parity error interrupt disable 1 parity error interrupt enable 4 frameerrorie framing error interrupt enable 0 framing error interrupt disable 1 framing error interrupt enable 5 overrunerrorie overrun error interrupt enable 0 overrun error interrupt disable 1 overrun error interrupt enable 7:6 reserved. write 0, will read back 0. table 13.6 ascintenable register format
st20-gp1 84/116 a ascstatus register the ascstatus register determines the cause of an interrupt. ascstatus asc base address + #14 read only bit bit ?eld function 0 rxbuffull receiver buffer full ?ag 0 receiver buffer not full 1 receiver buffer full 1 txempty transmitter empty ?ag 0 transmitter not empty 1 transmitter empty 2 txbufempty transmitter buffer empty ?ag 0 transmitter buffer not empty 1 transmitter buffer empty 3 parityerror parity error ?ag 0 no parity error 1 parity error 4 frameerror framing error ?ag 0 no framing error 1 framing error 5 overrunerror overrun error ?ag 0 no overrun error 1 overrun error 7:6 reserved. write 0, will read back 0. table 13.7 ascstatus register format
st20-gp1 85/116 a 14 parallel input/output the st20-gp1 device has 6 bits of parallel input/output (pio), each bit is programmable as an input or an output. the input bits can be compared against a register and an interrupt generated when the value is not equal. 14.1 pio port each of the bits of the pio port has a corresponding bit in the pio registers associated with the port. these registers hold: output data for the port ( pout ); the input data read from the pin ( pin ); pio bit con?guration register ( pc1 ); and the two input compare function registers ( pcomp and pmask ). all of the registers, except the pin register, are each mapped onto three separate addresses so that bits can be set or cleared individually. the set_ register allows bits to be set individually. writing a 1 in this register sets the corresponding bit in the associated register, a 0 leaves the bit unchanged. the clear_ register allows bits to be cleared individually. writing a 1 in this register resets the corresponding bit in the associated register, a 0 leaves the bit unchanged. 14.1.1 pio data registers the base addresses for the pio registers are given in the memory map chapter. pout register this register holds output data for the port. pout pio port base address + #00 read/write bit bit ?eld function 0 pout0 output data bit 0 1 pout1 output data bit 1 2 pout2 output data bit 2 3 pout3 output data bit 3 4 pout4 output data bit 4 5 pout5 output data bit 5 table 14.1 pout register format
st20-gp1 86/116 a pin register the data read from this register will give the logic level present on an input pin at the start of the read cycle to this register. the read data will be the last value written to the register irrespective of the pin con?guration selected. 14.1.2 pio bit con?guration register the pc1 register is used to con?gure each of the pio port bits as an input or output. writing a 0 con?gures the bit as an input, a 1 con?gures the bit as an output. 14.1.3 pio input compare and compare mask registers the input compare ( pcomp ) register holds the value to which the input data from the pio port pins will be compared. if any of the input bits are different from the corresponding bits in the pcomp register, and the corresponding bit in the compare mask ( pmask ) register is set to 1, then the internal interrupt signal for the port will be set to 1. the compare function is sensitive to changes in levels on the pins and so the change in state on the input pin must be greater in duration than the interrupt response time for the compare to be seen as a valid interrupt by an interrupt service routine. pin pio port base address + #10 read only bit bit ?eld function 0 pin0 input data bit 0 1 pin1 input data bit 1 2 pin2 input data bit 2 3 pin3 input data bit 3 4 pin4 input data bit 4 5 pin5 input data bit 5 table 14.2 pin register format pc1 pio port base address + #30 read/write bit bit ?eld function 0 con?gdata0 con?gures the pio bit 0 as an input or an output. 1 con?gdata1 con?gures the pio bit 1 as an input or an output. 2 con?gdata2 con?gures the pio bit 2 as an input or an output. 3 con?gdata3 con?gures the pio bit 3 as an input or an output. 4 con?gdata4 con?gures the pio bit 4 as an input or an output. 5 con?gdata5 con?gures the pio bit 5 as an input or an output. table 14.3 pc1 register format
st20-gp1 87/116 a pcomp pio port base address + #50 read/write bit bit ?eld function 0 pcomp0 value to which input data bit 0 will be compared. 1 pcomp1 value to which input data bit 1 will be compared. 2 pcomp2 value to which input data bit 2 will be compared. 3 pcomp3 value to which input data bit 3 will be compared. 4 pcomp4 value to which input data bit 4 will be compared. 5 pcomp5 value to which input data bit 5 will be compared. table 14.4 pcomp register format pmask pio port base address + #60 read/write bit bit ?eld function 0 pmask0 when set to 1, the compare function for the internal interrupt for the port is enabled. when enabled, if input data bit 0 is different to pcomp0 then an interrupt is generated. 1 pmask1 when set to 1, the compare function for the internal interrupt for the port is enabled. when enabled, if input data bit 1 is different to pcomp1 then an interrupt is generated. 2 pmask2 when set to 1, the compare function for the internal interrupt for the port is enabled. when enabled, if input data bit 2 is different to pcomp2 then an interrupt is generated. 3 pmask3 when set to 1, the compare function for the internal interrupt for the port is enabled. when enabled, if input data bit 3 is different to pcomp3 then an interrupt is generated. 4 pmask4 when set to 1, the compare function for the internal interrupt for the port is enabled. when enabled, if input data bit 4 is different to pcomp4 then an interrupt is generated. 5 pmask5 when set to 1, the compare function for the internal interrupt for the port is enabled. when enabled, if input data bit 5 is different to pcomp5 then an interrupt is generated. table 14.5 pmask register format
st20-gp1 88/116 a 15 byte-wide parallel port the byte-wide parallel port is provided to drive an external device using 8-bit half-duplex streamed i/o and two control wires. the byte-wide parallel port has 2 modes of operation, as follows: ? it can operate as an asic interface. in this mode the external data transfer is controlled by the emi strobes and addresses. ? it can operate as a byte-wide parallel link (plink) using an external asynchronous transfer mechanism to control transfers. the mode of operation is determined by the setting of the con?guration registers, see section 15.3. 15.1 emi mode operation in this mode the emi is in total control of the plinkdata0-7 pins. the plinknotack output is forced to its inactive state during this mode. the interface to the external device is controlled by the emi. the bottom 8 bits of the emi data bus ( memdata0-7 ) are redirected (copied) to the plinkdata0-7 pins. the direction of these pads is controlled by the emi. the external timing and data transfer of this activity is controlled by the programmed con?guration of the emi bank 2 (see section 9.5 on page 58). 15.2 parallel link (dma) mode operation in this mode the byte-wide parallel port is a dma (direct memory access) engine which performs memory transfers to and from the external links on behalf of a controller (the cpu). the parallel link is unidirectional and only transfers data in one direction across the memory bus at any given time. the byte-wide parallel port defaults to input (to the st20-gp1) when the st20-gp1 is reset (with the notrst pin) to prevent contention, and can be used for dma functions without interfering with memory bank 2. however to access external registers via the plinkdata0-7 pins, the bit in the plinkemi register (see table 15.1) must be set by software. this results in all accesses to external memory bank 2 being diverted via the port rather than memdata0-7 , allowing both register and dma access to the external peripheral. external memory bank 2 must be dedicated solely for this use while the register access of this external peripheral is enabled. being half-duplex, the direction of the link when in dma mode must be selected in software by setting the bit in the plinkio register (see table 15.2 below). data transfer for the parallel port (for dma transfers) occur by the use of a channel. when the emi is using these pads the directionality is controlled by the emi and not the dma control register. 15.3 con?guration registers there are three control registers for the parallel port which are programmed by use of devsw (device store) and devlw (device load) instructions. the base address for the parallel port con?guration registers is given in the memory map chapter.
st20-gp1 89/116 a plinkemi register the plinkemi register determines the mode of operation of the port. plinkio the plinkio register determines the direction of the port interactions when in the dma mode of operation. plinkmode the plinkmode register determines the external protocol used for interactions. 15.4 external data transfer protocols the byte-wide parallel port has three control pins. plinknotreq and plinknotack control data transfers and the plinkout pin controls external buffers, if required (e.g. an external 3v/5v buffer device). when the plinkout pin is high it signals the plink is outputting. the control pins can support three external protocols, as follows: ? dreq/dack protocol ? valid/ack protocol ? direct dma protocol the protocol used for interactions is programmable via the plinkmode register. in addition, the direction of the link is controlled by the plinkio register (see table 15.2). plinkemi parallel port base address + #00 read/write bit bit ?eld function 0 plinkemi this bit determines the mode of operation of the port. plinkemi mode 0 dma mode (reset state) 1 emi mode table 15.1 plinkemi register format plinkio parallel port base address + #04 read/write bit bit ?eld function 0 plinkio this bit controls the direction of the parallel port interactions when in dma mode. plinkio direction 0 inputs (reset state) 1 outputs table 15.2 plinkio register format plinkmode parallel port base address + #08 read/write bit bit ?eld function 0 plinkmode these bits control the external protocol used for interactions. plinkmode protocol 00 idle (reset state) 01 dreq/dack mode 10 valid/ack mode 11 direct mode table 15.3 plinkmode register format
st20-gp1 90/116 a 15.4.1 dreq/dack protocol in this mode the 2 control pins plinknotreq (dreq) and plinknotack (dack) are active low. the initial (inactive) state of the 2 control wires is high. dreq/dack output the sequence of events for a dreq/dack output is outlined below. 1 plinknotreq (dreq), input to st20, is taken low by the external asic. 2 the st20-gp1 asserts the plinknotack (dack) output low. the asic can then take plinknotreq (dreq) high. 3 following plinknotack (dack) going low, the data in the dma buffer is applied to the output pins. plinknotack (dack) is forced high and the output drivers are tristated. the asic can initiate the next transfer. dreq/dack input the sequence of events for a dreq/dack input is outlined below. 1 plinknotreq (dreq), input to st20, is taken low by the external asic. 2 the st20-gp1 then asserts the plinknotack (dack) output low. 3 the external asic applies the data to be transferred to the plinkdata0-7 pins. the asic can then return plinknotreq (dreq) high at any time. 4 the data on the input pins is sampled, then plinknotack (dack) is forced high. figure 15.1 dreq/dack protocol st20 output plinknotreq plinknotack plinkdata0-7 st20 input plinknotreq plinknotack plinkdata0-7 (dreq) (dack) (dreq) (dack)
st20-gp1 91/116 a 15.4.2 valid/ack protocol in this mode the 2 control pins plinknotreq (qack/ivalid) and plinknotack (qvalid/iack) are active high. the initial (inactive) state of the 2 control wires is low. valid ack output an output transaction proceeds as follows. 1 the dma is programmed to perform an out and the dma engine receives its ?rst byte in the buffer from the emi. 2 the plink drives the data to the plinkdata0-7 pins and drives plinknotack (qvalid) high. 3 the external device acknowledges receipt of the data by taking plinknotreq (qack) high. the plink can then take plinknotack (qvalid) low. 4 the external device can take plinknotreq (qack) low ready for the next transaction. valid ack input an input transaction proceeds as follows. 1 the external device drives the data pins and plinknotreq (ivalid) is asserted high. 2 if the dma engine has empty buffer space plinkdata0-7 is latched and plinknotack (iack) is driven high by the plink. the dma writes to the appropriate address in memory. 3 the external device can then drive plinknotreq (ivalid) low. 4 plinknotack (iack) can be taken low. the external device can then initiate the next transac- tion. figure 15.2 valid/ack protocol st20 output plinknotack plinknotreq st20 input plinknotreq plinknotack plinkdata0-7 plinkdata0-7 valid data old data (qvalid) (qack) (ivalid) (iack)
st20-gp1 92/116 a 15.4.3 direct dma protocol in this mode the plink becomes an unsynchronized (i.e. direct action) bus. the plinknotack output still behaves as if it were acknowledging a real transfer. the plinknotreq signal has no effect in this mode of operation. in this mode plinknotack is active high. the initial (inactive) state of the pin is low. direct mode output to drive the output pins the plink must be programmed to make a single byte dma. if more than one byte is output, the plink will continue to drive the output pins as fast as the output dma can feed the data, i.e. once every 8 or more system clock cycles, until the correct number of bytes have been output. the sequence of events for a single byte read is outlined below. when con?gured as an output the drivers are always driven. 1 the plink forces the plinknotack pin high. the output pins are then driven with the new data and the plinknotack pin is forced low. 2 the output data remains static and driven to the pads until either a new value is written as output or until the link direction is changed. if the plink returns to direct output mode, the old data is once again driven to the pads. note: at reset plinknotack is a logic one, appearing to the outside world as an acknowledge. external logic will assume that the data has been read. therefore after programming the plink to direct mode the plinknotack output falls. direct mode input to read the input pins the plink must be programmed to make a single byte dma. the sequence of events for a single byte read is outlined below. 1 the plink forces the plinknotack pin high. the input pins are then read and the plinkno- tack pin is forced low. figure 15.3 direct dma protocol st20 output plinknotack plinkdata0-7 st20 input plinknotack plinkdata0-7 valid data
st20-gp1 93/116 a 16 con?guration register addresses this chapter lists all the st20-gp1 con?guration registers and gives the addresses of the registers. the complete bit format of each of the registers and its functionality is given in the relevant chapter. the registers can be examined and set by the devlw (device load word) and devsw (device store word) instructions. note, they cannot be accessed using memory instructions. register address size set clear read/ write handlerwptr0 #20000000 32 r/w handlerwptr1 #20000004 32 r/w handlerwptr2 #20000008 32 r/w handlerwptr3 #2000000c 32 r/w handlerwptr4 #20000010 32 r/w triggermode0 #20000040 3 r/w triggermode1 #20000044 3 r/w triggermode2 #20000048 3 r/w triggermode3 #2000004c 3 r/w triggermode4 #20000050 3 r/w pending #20000080 5 interrupt trigger interrupt grant r/w set_pending #20000084 5 w clear_pending #20000088 5 w mask #200000c0 17 r/w set_mask #200000c4 17 w clear_mask #200000c8 17 w exec #20000100 5 interrupt valid interrupt done r/w set_exec #20000104 5 w clear_exec #20000108 5 w lptimerls #20000400 32 r/w lptimerms #20000404 32 r/w lptimerstart #20000408 1 by a write to lp- timerls or lp- timerms r/w lpalarmls #20000410 32 r/w lpalarmms #20000414 8 r/w lpalarmstart #20000418 1 r/w lpsyspll #20000420 2 r/w sysratio #20000500 6 r wdenable #20000510 1 r/w table 16.1 st20-gp1 con?guration register addresses
st20-gp1 94/116 a wdflag #20000514 1 r emicon?gdatafield0 #20002000 32 r/w emicon?gdatafield1 #20002004 32 r/w emicon?gdatafield2 #20002008 32 r/w emicon?gdatafield3 #2000200c 32 r/w emicon?glock #20002010 32 w emicon?gstatus #20002020 32 r emicon?gstall #20002030 32 w asc0baudrate #20004000 16 r/w asc0txbuffer #20004004 16 w asc0rxbuffer #20004008 16 r asc0control #2000400c 16 r/w asc0intenable #20004010 8 r/w asc0status #20004014 8 r asc1baudrate #20006000 16 r/w asc1txbuffer #20006004 16 w asc1rxbuffer #20006008 16 r asc1control #2000600c 16 r/w asc1intenable #20006010 8 r/w asc1status #20006014 8 r pout #20008000 6 r/w set_pout #20008004 6 w clear_pout #20008008 6 w pin #20008010 6 r pc1 #20008030 6 r/w set_pc1 #20008034 6 w clear_pc1 #20008038 6 w pcomp #20008050 6 r/w set_pcomp #20008054 6 w clear_pcomp #20008058 6 w pmask #20008060 6 r/w set_pmask #20008064 6 w clear_pmask #20008068 6 w plinkemi #2000a000 1 r/w plinkio #2000a004 1 r/w plinkmode #2000a008 2 r/w register address size set clear read/ write table 16.1 st20-gp1 con?guration register addresses
st20-gp1 95/116 a prncode0 #2000c000 7 w prncode1 #2000c004 7 w prncode2 #2000c008 7 w prncode3 #2000c00c 7 w prncode4 #2000c010 7 w prncode5 #2000c014 7 w prncode6 #2000c018 7 w prncode7 #2000c01c 7 w prncode8 #2000c020 7 w prncode9 #2000c024 7 w prncode10 #2000c028 7 w prncode11 #2000c02c 7 w prnphase0 #2000c040 19 w prnphase0wren 1 r prnphase1 #2000c044 19 w prnphase1wren 1 r prnphase2 #2000c048 19 w prnphase2wren 1 r prnphase3 #2000c04c 19 w prnphase3wren 1 r prnphase4 #2000c050 19 w prnphase4wren 1 r prnphase5 #2000c054 19 w prnphase5wren 1 r prnphase6 #2000c058 19 w prnphase6wren 1 r prnphase7 #2000c05c 19 w prnphase7wren 1 r prnphase8 #2000c060 19 w prnphase8wren 1 r prnphase9 #2000c064 19 w prnphase9wren 1 r prnphase10 #2000c068 19 w prnphase10wren 1 r prnphase11 #2000c06c 19 w prnphase11wren 1 r register address size set clear read/ write table 16.1 st20-gp1 con?guration register addresses
st20-gp1 96/116 a ncofrequency0 #2000c080 18 w ncofrequency1 #2000c084 18 w ncofrequency2 #2000c088 18 w ncofrequency3 #2000c08c 18 w ncofrequency4 #2000c090 18 w ncofrequency5 #2000c094 18 w ncofrequency6 #2000c098 18 w ncofrequency7 #2000c09c 18 w ncofrequency8 #2000c0a0 18 w ncofrequency9 #2000c0a4 18 w ncofrequency10 #2000c0a8 18 w ncofrequency11 #2000c0ac 18 w ncophase0 #2000c0c0 7 w nco1phase #2000c0c4 7 w ncophase2 #2000c0c8 7 w ncophase3 #2000c0cc 7 w ncophase4 #2000c0d0 7 w ncophase5 #2000c0d4 7 w ncophase6 #2000c0d8 7 w ncophase7 #2000c0dc 7 w ncophase8 #2000c0e0 7 w ncophase9 #2000c0e4 7 w ncophase10 #2000c0e8 7 w ncophase11 #2000c0ec 7 w prninitialval0 #2000c100 10 w prninitialval1 #2000c104 10 w dspcontrol #2000c140 4 w register address size set clear read/ write table 16.1 st20-gp1 con?guration register addresses
st20-gp1 97/116 a 17 electrical speci?cations absolute maximum ratings operation beyond the absolute maximum ratings may cause permanent damage to the device. all voltages are measured referred to gnd . notes 1 for a package junction to case thermal resistance of 14 c/w. 2 for reliability reasons the long-term current from any pin may be limited to a lower value than stated here. operating conditions notes 1 for a package junction to case thermal resistance of 14 c/w. 2 the nominal input clock frequency must be 16.368 mhz for the dsp module to function cor- rectly with the gps satellites. symbol parameter min max units notes v dd dc power supply -0.5 4.5 v v ddrtc voltage at rtcvdd pin referred to gnd -0.5 4.5 v t s storage temperature (ambient) -55 125 c t j temperature under bias (junction) -40 125 c1 i o continuous dc output current from any output pin. -20 20 ma 2 v i applied voltage to all functional pins excluding lpclockin, notrst and test control pins. -0.5 v dd + 0.5 v v irtc applied voltage to lpclockin, notrst and test control pins. -0.5 v ddrtc + 0.5 v v o voltage on bi-directional and output pins except notmemce0 . -0.5 v dd + 0.5 v v ortc voltage on the notmemce0 pin -0.5 v ddrtc + 0.5 v pd max power dissipation in package 2.0 w table 17.1 absolute maximum ratings symbol parameter min max units notes t a ambient operating temperature of case -40 85 c t j operating temperature of junction -40 125 c1 v i applied voltage to all functional input pins and bidirectional pins excluding lpclockin , notrst and test control pins. 0v dd v v irtc applied voltage to lpclockin, notrst and test control pins 0 v ddrtc v f clk clockin frequency clockin frequency in timesonemode 16.5 36 mhz mhz 2 c l load capacitance per pin 50 pf table 17.2 operating conditions
st20-gp1 98/116 a dc speci?cations notes 1 this is the static speci?cation to ensure low current. 2 output current of 2ma. 3 output current of -2ma. 4 excludes power used to drive external loads. includes operation of the 32 khz watch crys- tal oscillator. 5 device operation suspended by use of the low power controller with vdd and rtcvdd within speci?cation. frequency of system clock (fclk) is 16.368 mhz and frequency of low power clock is 32768 hz. 6 with rtcvdd within speci?cation and vdd at 0 v. all inputs static except lowpower- clockin and lowpowerclockosc , frequency of low power clock 32768 hz. all other inputs must be in the range -0.1 to 0.1 v. symbol parameter min typical max units notes v dd positive supply voltage during normal operation. 3.0 3.3 3.6 v v ddoff positive supply voltage when device is off but real time clock is running. -0.3 0 0.3 v v ddrtc voltage at rtcvdd pin referred to gnd . 3.0 3.3 3.6 v v dddiff v dd -v ddrtc during normal operation and notrst set to 1. -0.3 0 0.3 v 1 v ih input logic 1 for lpclockin , notrst and test control pins. input logic 1 for all other inputs. pio pins. 2.0 2.0 2.4 v ddrtc + 0.5 v dd + 0.5 v dd + 0.5 v v il input logic 0 for all inputs. -0.5 0.8 i in input current to input pins. -10 10 m a i oz off state digital output current. -50 50 m a v ohdc output logic 1 2.4 v dd v2 v oldc output logic 0 0 0.4 3 c in input capacitance (input only pins). 4 10 pf c out output capacitance and capacitance of bidirectional pins. 6 15 pf p op operational power consumption under heavy device activity. fclk of 16.368 mhz and speedselect set to pll operation (x1). no external memory used. 0.5 0.8 w 4 p app operational power consumption under typical device activity. fclk of 16.368 mhz and speedselect set to pll operation (x2). external memory used. 0.75 1.1 w 4 p stby operational power during stand-by. 0.16 0.3 w 5 p rtc operational power for the real time clock only, supplied through the rtcvdd pin. 1mw6 table 17.3 dc speci?cation
st20-gp1 99/116 a ac speci?cations notes 1 the maximum is only a guideline to ensure a low current consumption during the change in vdd . 2 the transition need not be monotonic, providing that the notrst pin is forced low during the whole period while the main vdd voltage is not within limits set in the dc operating conditions. symbol parameter min typical max units notes t vddr rise time of vdd during power up (measured between 0.3 v and 2.7 v). 5 ns 100 ms 1, 2 t vddf fall time of vdd during power down (measured between 2.7 v and 0.3 v). 5 ns 100 ms 1, 2 table 17.4 ac speci?cation
st20-gp1 100/116 a 18 gps performance this chapter details the performance of a st20-gp1 based gps receiver. note that the performance is dependent on the quality of the user radio, antenna and software used to track the signal and to calculate the resultant position. 18.1 accuracy 18.1.1 benign site the accuracy performance of a gps receiver is dependent on external factors, in particular the deliberate degradation of the signal by the us dod, known as selective availability (sa). this results in an error speci?cation of 100m. if signal errors are corrected by differential gps, the st20-gp1 can achieve better than 1m accuracy with 1-second rate corrections. note that the st20-gp1 supports the rtca-sc159 provided corrections with no additional hardware. for surveying use, the resolution of the counters used in the phase/frequency tracking allows resolution down to 1mm. 18.1.2 under harsh conditions under harsh conditions, accuracy degrades due to: ? noise on the weakened signal ? re?ected signals from buildings and cliffs ? obstruction of satellites the st20-gp1 pays a 2 db signal/noise ratio penalty by using 1-bit signal coding, there are then no further losses in the signal processing hardware. the fast sampling rate, with both in-phase and quadrature channels, results in the subsequent processing being 11 db better, on a signal to noise ratio, than earlier systems that sample at 2 mhz. thus there is a 9 db overall improvement. accuracy stand alone with selective availability without selective availability < 100m < 30m differential < 1m surveying < 1cm table 18.1 accuracy performance
st20-gp1 101/116 a 18.2 time to ?rst ?x condition receiver situation time to ?rst ?x autonomous start the receiver has no estimate of time/date/position and no recent almanac 90s cold start the receiver has estimated time/date/position and almanac 45s warm start the receiver has estimated time/date/position and almanac and still valid ephemeris data 7s obscuration the receiver has precise time (to m s level) as its calibrated clock is not stopped 1s table 18.2 time to ?rst ?x
st20-gp1 102/116 a 19 timing speci?cations 19.1 emi timings the timings are based on a 50 pf load, and are taken at a threshold of 1.5 v. table 19.1 emi cycle timings note : the reference clock used in the emi timings is a virtual clock and is de?ned as the point at which all data and address outputs are valid. this is designed to remove process dependent skews from the datasheet description and highlight the dominant in?uence of address and data timings on memory system design. symbol parameter min max units notes t chav reference clock high to address valid -9.0 0.0 ns t clsv reference clock low to strobe valid -11.0 3.0 ns t chsv reference clock high to strobe valid -9.0 0.0 ns t rdvch read data valid to reference clock high 32.0 - ns t chrdx read data hold after reference clock high -9.0 - ns t chwdv reference clock high to write data valid -9.0 2.0 ns t wvch memwait valid to reference clock high 27.0 - ns t chwx memwait hold after reference clock high -6.0 - ns
st20-gp1 103/116 a figure 19.1 emi timings memdata0-15 t rdvch (read) t chwdv t chsv t clsv t chrdx memwait t wvch t chwx t chav reference clock memaddr1-19 notmemce0-3 notmemoe0-3 notmemwb0-1 memdata0-15 (write)
st20-gp1 104/116 a 19.2 link timings notes 1 this is the variation in the total delay through buffers, transmission lines, differential receiv- ers etc., caused by such things as short term variation in supply voltages and differences in delays for rising and falling edges. table 19.2 link timings figure 19.2 link timings figure 19.3 buffered link timings symbol parameter min nom max units notes t jqr linkout rise time 20 ns t jqf linkout fall time 10 ns t jdr linkin rise time 20 ns t jdf linkin fall time 20 ns t jqjd buffered edge delay 0 ns d t jb variation in t jqjd 20 mbits/s 3 ns 1 10 mbits/s 10 ns 1 5 mbits/s 30 ns 1 c liz linkin capacitance @ f=1mhz 10 pf c ll linkout load capacitance 50 pf t jqf 90% 10% t jqr t jdf 90% 10% t jdr linkout linkin 1.5 v latest t jqjd linkout linkin 1.5 v d t jb earliest t jqjd
st20-gp1 105/116 a 19.3 reset and analyse timings table 19.3 reset and analyse timings figure 19.4 reset and analyse timings symbol parameter min nom max units notes t rhrl notrst pulse width low 8 clockin t rhrl cpureset pulse width high 1 clockin t ahrh cpuanalyse setup before cpureset 3 ms t rlal cpuanalyse hold after cpureset end 1 clockin cpuanalyse cpureset t rhrl t rhrl t rlal t ahrh notrst t rsthrstl
st20-gp1 106/116 a 19.4 clockin timings notes 1 measured between corresponding points on consecutive falling edges. 2 variation of individual falling edges from their nominal times. 3 clock transitions must be monotonic within the range v ih to v il (see electrical speci?ca- tions). table 19.4 clockin timings figure 19.5 clockin timings 19.4.1 clockin frequency nominal clockin frequency is 16.36800 mhz 50 ppm tolerance. this tolerance relates to the gps system requirements and not for the device to function. symbol parameter min nom max units notes t dcldch clockin pulse width low for pll operation 18 42.5 ns t dchdcl clockin pulse width high for pll operation 18 42.5 ns t dcr clockin rise time for pll operation 20 ns 3 t dcf clockin fall time for pll operation 20 ns 3 t gdvch gpsif valid before clock rising edge 20 ns t chgdx gpsif valid after clock rising edge 0 ns 90% 10% t dcr 2.0v 0.8v 1.5v t dcldch t dchdcl t dcf 90% 10% t gdvch t chgdx gpsif
st20-gp1 107/116 a 19.5 parallel port timings 19.5.1 dreq/dack protocol in this mode the two control pins plinknotreq (dreq) and plinknotack (dack) are active low. the initial (inactive) state of the two control wires is high. notes: 1 this will be a maximum of 200 ns if the port is already programmed either to accept another byte or to write another byte and the port has the data available. in the extreme case for a plink output this value could be very large if the link has to wait for other external accesses to complete before it can read the data to write out through the plink. figure 19.6 byte-wide parallel port timings when using the dreq/dack protocol symbol parameter min max units plink is output t palpdv plinknotack falling transition to plinkdata valid 100 ns t pahdox plinkdata hold time after rising edge of plinknotack 10 ns t pahdoz plinkdata output tristate time from plinknotack rising edge 90 ns plink is input t pahdix plinkdata hold after plinknotack rising edge 0 ns t paldiv plinkdata valid after plinknotack falling edge 20 ns plink is input or output t pahprl plinknotack rising edge to succeeding plinknotreq falling edge 0 ns t palpah plinknotack low time 55 340 ns t prlpal time between the input plinknotreq falling and the output plin- knotack falling 25 see note 1 ns table 19.5 timings for dreq/dack protocol plinknotreq plinknotack plinkdata0-7 t paldov t palpah t pahdox t prlpal plinkdata0-7 t pahdoz t pahprl (dreq) (dack) t paldiv t pahdix (output) (input)
st20-gp1 108/116 a 19.5.2 valid/ack protocol in this mode the two control pins plinknotreq (qack/ivalid) and plinknotack (qvalid/iack) are active high. the initial (inactive) state of the two control wires is low. figure 19.7 byte-wide parallel port timings when using the valid/ack protocol symbol parameter min max units plink is output t pahprh plinknotack rising transition to plinknotreq rising 0 ns t dovpah plinkdata0-7 setup time before rising edge of plinknotack 0ns t prhpal plinknotreq rising edge to plinknotack falling edge 0 ns t palprl plinknotreq falling edge after plinknotack falling edge 0 ns t prldox plinkdata0-7 hold time after plinknotreq falling edge (i.e. before new data may be put onto bus) 0ns plink is input t divprh plinkdata setup time before plinknotreq rising edge 0 ns t pahdix plinkdata hold after plinknotack rising edge 0 ns t pahprl plinknotreq falling edge after plinknotack rising edge 0 ns t prlpah plinknotreq falling edge to plinknotack rising edge 0 ns t prlpal plinknotack falling edge after plinknotreq falling edge 40 300 ns t palprh plinknotreq rising edge after plinknotack falling edge 0 ns table 19.6 timings for valid/ack protocol st20 output plinknotack plinknotreq plinkdata0-7 t dovpah t pahprh t prlpah t pahdix st20 input plinknotreq plinknotack plinkdata0-7 t palprh t pahprl t prlpal valid data old data t palprl t dovprh t prhpal t prldox (qvalid) (qack) (ivalid) (iack)
st20-gp1 109/116 a 19.5.3 direct dma protocol in this mode plinknotack is active high. the initial (inactive) state of the pin is low. figure 19.8 byte-wide parallel port timings when using the direct dma protocol symbol parameter 16.4 mhz 32.7 mhz units min max min max plink is output t paldox plinkdata hold after plinknotack falling edge 330 160 ns t dovpal plinkdata valid to plinknotack fall- ing transition 100 40 ns plink is input t paldix plinkdata hold after plinknotack falling edge 00ns t divpal plinkdata valid to plinknotack fall- ing transition 100 70 ns plink is input or output t pahpal plinknotack high time 220 270 100 140 ns t palpah plinknotack low time 220 270 100 140 ns table 19.7 timings for direct mode (output) (input) plinknotack plinkdata0-7 t dovpal t pahpal t paldix plinkdata0-7 t palpah t paldox t divpal
st20-gp1 110/116 a 20 pin list signals names are pre?xed by not if they are active low, otherwise they are active high. supplies clocks system services links interrupts pin in/out function vdd power supply gnd ground table 20.1 st20-gp1 supply pins pin in/out function lowpowerclockin in low power input clock lowpowerclockosc in/out low power clock oscillator lowpowerstatus out low power status notwdreset out watchdog timer reset rtcvdd in real time clock supply table 20.2 st20-gp1 low power controller and real time clock pins pin in/out function clockin in system input clock C pll or timesonemode speedspeed0-1 in speed selectors notrst in reset cpureset in system reset cpuanalyse in error analysis errorout out error indicator table 20.3 st20-gp1 system services pins pin in/out function linkin in serial data input channel linkout out serial data output channel table 20.4 st20-gp1 link pins pin in/out function interrupt0-1 in interrupts table 20.5 st20-gp1 interrupt pins
st20-gp1 111/116 a memory uart parallel io byte wide parallel port application speci?c miscellaneous pin in/out function memaddr1-19 out address bus memdata0-15 in/out data bus. data0 is the least significant bit (lsb) and data15 is the most signi?cant bit (msb). memwait in memory cycle extender notmemoe0-3 out output enable strobes C one per bank notmemce0-3 out chip enable strobes C one per bank notmemwb0-1 out used as write strobe, or memaddr0 on 8-bit bus. bootsource0-1 in boot from rom or from link table 20.6 st20-gp1 memory pins pin in/out function txd0-1 out uart serial data output rxd0-1 in uart serial data input table 20.7 st20-gp1 uart pins pin in/out function pio0-5 in/out pio table 20.8 st20-gp1 parallel io pins pin in/out function plinkdata0-7 in/out bidirectional data bus plinknotreq in data transfer request plinknotack out data transfer acknowledge plinkout out controls external buffers. when high signals the plink is outputting. table 20.9 st20-gp1 byte wide parallel port pins pin in/out function gpsif in gps if input table 20.10 st20-gp1 application speci?c pins pin in/out function connecttognd must be connected to gnd table 20.11 st20-gp1 miscellaneous pins
st20-gp1 112/116 a 21 package speci?cations the st20-gp1 is available in a 100 pin plastic quad ?at pack (pqfp) package. 21.1 st20-gp1 package pinout figure 21.1 st20-gp1 100 pin pqfp package pinout
st20-gp1 113/116 a 21.2 100 pin pqfp package dimensions notes 1 lead ?nish to be 60 sn/40 pb solder plate. 2 maximum lead displacement from the notional centre line will be no greater than 0.125 mm. table 21.1 100 pin pqfp package dimensions ref. control dim. mm min alternative dim. inches min notes a - - 3.400 - - 0.134 a1 0.100 - - 0.004 - - a2 2.540 2.800 3.050 0.096 0.110 0.120 b 0.220 - 0.380 0.009 - 0.015 c 0.130 - 0.230 0.005 - 0.009 d 22.950 - 24.150 0.904 - 0.951 d1 19.900 20.000 20.100 0.783 0.787 0.791 d3 - 18.850 - - 0.742 - ref e 16.950 - 18.150 0.667 - 0.715 e1 13.900 14.000 14.100 0.547 0.551 0.555 e3 - 12.350 - - 0.486 - ref e - 0.650 - - 0.026 - bsc g - - 0.100 - - 0.004 k 0 - 7 0 - 7 l 0.650 0.800 0.950 0.026 0.031 0.037 zd - 0.580 - - 0.23 - ref ze - 0.830 - - 0.033 - ref
st20-gp1 114/116 a figure 21.2 100 pin pqfp package dimensions
st20-gp1 115/116 a 22 device id the identi?cation code for the st20-gp1 is # m 5191011, where m is a manufacturing revision number reserved by sgs-thomson. see table 22.1. the identi?cation code is returned by the lddevid instruction, see table 6.4. 23 ordering information for further information contact your local sgs-thomson sales of?ce. a. 0 indicates sgs-thomson part, 1 indicates customer part. b. de?ned as 1 in ieee 1149.1 standard. bit 31 bit 0 mask rev a st20 family variant sgs-thomson manufacturers id b 0101000110010001000000010001 5191011 table 22.1 identi?cation code device package ST20GP1X33S 100 pin plastic quad ?atpack (pqfp) reserved
st20-gp1 116/116 a information furnished is believed to be accurate and reliable. however, sgs-thomson microelectronics assumes no responsibility for the conse- quences of use of such information nor for any infringement of patents or other rights of third parties which may result from i ts use. no license is granted by implication or otherwise under any patent or patent rights of sgs-thomson microelectronics. speci?cations mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. sgs-thomson microelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of sgs-thomson microelectronics. ? 1996 sgs-thomson microelectronics - all rights reserved ims and ds-link are trademarks of sgs-thomson microelectronics limited. is a registered trademark of the sgs-thomson microelectronics group. sgs-thomson microelectronics group of companies australia - brazil - canada - china - france - germany - hong kong - italy - japan - korea - malaysia - malta - morocco - the netherlands - singapore - spain - sweden - switzerland - taiwan - thailand - united kingdom - u.s.a. a 116


▲Up To Search▲   

 
Price & Availability of ST20GP1X33S

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X